Commit Graph

208 Commits

Author SHA1 Message Date
Jeremy Ashkenas
1d90bb9cfc binding the comparator function before using it, so that you can rely on properties of your collection within it. 2012-01-12 15:13:22 -05:00
Jeremy Ashkenas
8cfb243b8e Fixes #836, Fixes #708 -- going back to previous stance: two models with the same id can't be added to the same collection. 2012-01-11 17:03:30 -05:00
Jeremy Ashkenas
cb7090db77 fixes #838 -- allow View#attributes to be defined as a function, as well as a value. 2012-01-11 16:47:50 -05:00
Jeremy Ashkenas
bf1ffbeb67 nice refactor. removed _add and _remove and moved 'em in to the public API. 2012-01-11 13:45:16 -05:00
Jeremy Ashkenas
eb868b66c8 merging in #846 2012-01-11 12:28:38 -05:00
Jeremy Ashkenas
2312b9072c adding a test to ensure that routes aren't triggered multiple times. #849 2012-01-11 12:11:10 -05:00
Brad Dunbar
c8919c4b05 collection.add should not alter models array 2012-01-10 17:18:11 -05:00
Jeremy Ashkenas
1715c181ad Fixes #81 -- optimize for addition of large arrays of models, not for individual inserts. 2012-01-06 15:42:43 -05:00
Jeremy Ashkenas
6b3ff7b035 Fixes #9, Backbone comparators can now be either sort() or sortBy() iterators. 2012-01-06 14:53:43 -05:00
Jeremy Ashkenas
060da2b991 Merge pull request #842 from braddunbar/hasChanged-comparison
hasChanged/set should use the same comparison
2012-01-06 06:58:55 -08:00
Brad Dunbar
934aba4c6e hasChanged/set should use the same comparison
When setting a value, if hasChanged and set disagree
about equality then hasChanged will return true without
firing a 'changed:*' event (or vice versa).  Using the
same comparison (_.isEqual) solves this problem.
2012-01-06 09:19:23 -05:00
Jeremy Ashkenas
061fd3ba4f Merge pull request #809 from islandr/master
Allow Model.urlRoot to be a function
2011-12-25 22:46:12 -08:00
=
b4e650b98f A model's urlRoot can now be a function allowing definition at runtime. 2011-12-22 15:23:12 -10:00
Irene Ros
9d145abfe8 Forcing quint test execution order. 2011-12-22 12:23:50 -05:00
Jeremy Ashkenas
dd83f2057c Fixes #788 2011-12-19 11:20:37 -05:00
Magnus Holm
67f689df9c Col.fetch() should create models with parse:true:
This is done in two steps:

1. Col.fetch() now defaults to parse:true
2. Col.reset() and _prepareModel now passes along
   parse:true.

This means that Col.add() also accepts the
parse:true option.
2011-12-04 18:27:36 +01:00
Magnus Holm
bdbcfa9da2 parse:true runs the attributes through parse():
`new Model(attr, {parse:true})` will now call
Model.prototype.parse(attr). This is useful if
you want to create a model out of an object
structure from an external server.
2011-12-04 17:48:47 +01:00
Jeremy Ashkenas
9fc7443d34 merging in #758 -- although the API leaves something to be desired. 2011-11-23 17:32:04 -05:00
Jeremy Ashkenas
6687cde196 merging in #739 -- a massive simplification. 2011-11-23 16:48:39 -05:00
Jeremy Ashkenas
bc9fbcbefb Merge branch 'set-unset-clear' of https://github.com/braddunbar/backbone 2011-11-23 15:57:24 -05:00
Jeremy Ashkenas
1332246b8f merging in #750 -- support for replaceSTate 2011-11-23 14:59:14 -05:00
Jeremy Ashkenas
30a89ac5cc Merge branch 'replaceState' of https://github.com/lmp/backbone 2011-11-23 14:03:39 -05:00
Jeremy Ashkenas
66800f5c8e Upgrading our Underscore.js test dep to 1.2.2 2011-11-23 13:30:07 -05:00
Aidan Feldman and Tim Harper
df7c279dc2 Navigate learns to change the route without adding a history entry
Also, instead of accepting a single boolean for trigger, the navigate
method now accepts an options object, with the following options:

- replace
- trigger

If you pass true instead of an options object, it's interpreted as
{trigger: true}

* pushState support - Aidan Feldman
* hashtag support and IE7 support - Tim Harper
* Tests were a joint effort.
2011-11-17 15:42:29 -07:00
Brad Dunbar
93ad86cfa9 add tests for #730 and #565 2011-11-10 13:45:27 -05:00
Brad Dunbar
66d209d4f9 unit test for ignore values when unsetting 2011-11-10 10:10:17 -05:00
Brad Dunbar
3f004196bd assert that change is only triggered once 2011-11-09 14:05:58 -05:00
Brad Dunbar
20a2e3408a set _changing = false only if !alreadyChanging 2011-11-09 13:56:43 -05:00
Jeremy Ashkenas
35600be547 Merge branch 'events' of https://github.com/braddunbar/backbone 2011-10-31 11:49:04 -04:00
Jeremy Ashkenas
39061ff48a Merge branch 'master' of github.com:documentcloud/backbone 2011-10-31 11:00:02 -04:00
Brad Dunbar
de2430554e implement callbacks as linked list 2011-10-31 07:15:03 -04:00
Tim Branyen
2156b9e28f Merge pull request #699 from jasonm/jm-bump-qunit
Update QUnit to 1.1.0 (newest stable)
2011-10-29 14:03:11 -07:00
Tim Branyen
9982e314cb Merge pull request #700 from iros/673
#673 - Adding index as a property on the options object that gets passed
2011-10-29 13:30:58 -07:00
Irene Ros
80769fcf99 #673 - Adding index as a property on the options object that gets passed when the add/remove callbacks get triggered on a collection. 2011-10-29 16:29:18 -04:00
Tim Branyen
fbffb36819 Merge pull request #698 from alexgraul/master
Fix for Issue #690
2011-10-29 13:21:15 -07:00
Jason Morrison
6717e42849 Bump jQuery test suite dependency from 1.5 to 1.6.4 2011-10-29 16:18:19 -04:00
Jason Morrison
c336e4b3d5 Update QUnit 2011-10-29 16:12:36 -04:00
Jeremy Ashkenas
b2407efb43 Merge branch 'router_no_callback' of https://github.com/derickbailey/backbone 2011-10-29 15:53:32 -04:00
Alex Graul
970ce0762c fix for wrapped errors inside success callbacks on save, issue #690 2011-10-29 15:51:41 -04:00
Jeremy Ashkenas
c37e2f9bd1 Merge branch 'master' of https://github.com/alexgraul/backbone 2011-10-29 13:28:02 -04:00
Alex Graul
567e0a3c2d Fix for adding models with custom set methods to collections, issue #539 2011-10-29 13:23:01 -04:00
Jeremy Ashkenas
b4f680e371 Merge branch 'master' of https://github.com/iros/backbone 2011-10-29 12:39:38 -04:00
Irene Ros
2be771412b Setting _unsetAttributes to false in unset rather than changedAttributes so that the unset attributes aren't lost on subsequent calls of changedAttributes. Added test to verify this behavior. 2011-10-29 12:27:46 -04:00
Irene Ros
f499fc8cfc Merge branch 'master' of github.com:spmason/backbone 2011-10-29 11:39:35 -04:00
Jeremy Ashkenas
32ae113298 upgrading to the latest version of Underscore. 2011-10-29 11:24:36 -04:00
Derick Bailey
6799c8e8be added a test and code to allow a router to define a route with no callback method for the route name 2011-10-06 19:09:53 -05:00
Les Hill
ef40512d84 Rename to undelegateEvents
As suggested by @jashkenas https://github.com/documentcloud/backbone/pull/620#issuecomment-2132400
2011-09-19 10:30:45 -07:00
Les Hill
1aaffa1302 Clear event callbacks with clearEvents 2011-09-18 23:29:51 -07:00
Jacob Thornton
084e0288e7 add support and tests for ender jeesh 2011-08-18 16:41:42 -07:00
Steve Mason
5310996d09 Test for unset attributes not being returned by changedAttributes 2011-08-11 08:55:12 +01:00