Commit Graph

260 Commits

Author SHA1 Message Date
Brad Dunbar
3ef9c3a5fc Add tests for #908, #933. 2012-02-03 10:17:45 -05:00
Brad Dunbar
1d921d690a Add tests for #906. 2012-02-02 20:26:41 -05:00
Brad Dunbar
954da679ed Refactor some tests.
* Use object for lastRequest to prevent errors.
* Ensure setDOMLibrary tests are cleaned up.
2012-02-02 19:36:50 -05:00
Jeremy Ashkenas
a865aa41f1 removing obsolete error case. 2012-02-02 17:15:28 -05:00
Jeremy Ashkenas
0ffd7ea2ca merging in setDomLibrary 2012-02-02 16:30:56 -05:00
Jeremy Ashkenas
eb4753862e #917, adding an Model#isValid() function. 2012-02-02 15:54:34 -05:00
Jeremy Ashkenas
aafbcb05e5 Fixes #917 -- reverts validate() behavior to never run on silent sets. 2012-02-02 15:40:06 -05:00
Brad Dunbar
29a4359ff7 fixes #915 - nested 'change:attr' events
* `'change'` does not fire without changes
* nested `'change:attr'` events are fired
* `'change'` is only fired once for nested calls
* nested `'change'` events are fired
2012-02-02 10:49:27 -05:00
Brad Dunbar
ec61503c87 fixes #928 - Save sends correct attrs.
* Temporarily set model's attrs for `sync`.
* Remove cross-module (global) dependencies in
  Collection, Model, and sync test modules.
2012-02-02 08:57:47 -05:00
Brad Dunbar
bc79feaf5a passing falsey keys to hasChanged or previous 2012-02-01 16:06:36 -05:00
James Sanders
e97c58f547 Change name to setDomLibrary 2012-01-31 17:25:41 -07:00
James Sanders
9bd086e64b Change from Backbone.use to Backbone.setjQuery and fix tests 2012-01-31 15:49:53 -07:00
Matt Smith
701350ab90 inject js library with Backbone.use(myLib) 2012-01-31 15:11:13 -07:00
Brad Dunbar
db95e2c1fb fixes #907 - save with wait succeeds without validate 2012-01-31 10:02:05 -05:00
Brad Dunbar
50e8103fdf check for duplicate models/ids 2012-01-30 15:24:41 -05:00
Jeremy Ashkenas
4b4f2c1ad6 missed an API regression in model.changedAttributes(), reimplementing in the same way as the original. 2012-01-30 12:18:58 -05:00
Brad Dunbar
2a6624cb24 use _.has for Object proto props 2012-01-30 05:52:47 -05:00
Brad Dunbar
2f654d2676 cache changed attributes 2012-01-30 05:00:41 -05:00
Brad Dunbar
0d6e5f3934 Fire 'change:attr' from change 2012-01-27 14:07:33 -05:00
Jeremy Ashkenas
ab164c450d Overhauling 'validate' -- Receives the computed new state of the attrs, not just the delta. Now runs on model create, raising an exception if you try to 'new' and invalid model ... also runs even if changed silently. 2012-01-23 18:16:20 -05:00
Jeremy Ashkenas
96a7274cf7 Fixes #538 -- adds Backbone.history.stop() for unit testers. 2012-01-23 10:31:53 -05:00
Jeremy Ashkenas
36fde545f9 Merge pull request #872 from vovik/master
fixed typo in test for (presumably) equality
2012-01-22 10:04:57 -08:00
Brad Dunbar
3a891854e8 setting undefined attributes
* undefined attrs should still be set
* unset triggers change for undefined attrs
* values are set regardless of change/equality
2012-01-20 11:02:46 -05:00
vlad
c7c7b3c1a1 fixed typo in test for (presumably) equality 2012-01-18 13:49:09 -08:00
Brad Dunbar
b05deb5fb5 fix #871 - calling set with 'attributes' property 2012-01-18 12:45:09 -05:00
Jeremy Ashkenas
910ca3c190 Merge pull request #866 from braddunbar/add-tweaks
Collection#add tweaks
2012-01-17 22:50:17 -08:00
Brad Dunbar
09ab8cb17d Collection#add tweaks
* leave collection in a consistent state after throw
* correct indices
2012-01-17 23:53:02 -05:00
Brad Dunbar
397d11e340 equals is deprecated; use equal instead
http://docs.jquery.com/QUnit/equal#actualexpectedmessage
2012-01-17 23:52:12 -05:00
Jeremy Ashkenas
cea56e523a Fixes #563. Initial draft of 'wait: true' for pessimistic instead of optimistic save() create() and destroy(). Makes it easier to have your asynchronous UI and eat it too. 2012-01-17 15:26:26 -05:00
Jeremy Ashkenas
0dedb05093 Merge pull request #862 from braddunbar/implicit-callback
Router: Use implicit callback if none provided
2012-01-17 11:02:32 -08:00
Jeremy Ashkenas
1c053d9f71 Fixes #567 ... Adds a view. for the jQuery cached reference to a view's element ... and this.setElement() as a way to easily change it, redelegating events. 2012-01-17 13:54:42 -05:00
Brad Dunbar
57ef21839b use implicit callback if none provided 2012-01-17 12:12:20 -05:00
Jeremy Ashkenas
42d321f236 Fixes #570, supports Model#save(key, value) 2012-01-17 11:55:15 -05:00
Jeremy Ashkenas
09110a6656 removing erroneous console.log 2012-01-17 11:18:17 -05:00
Jeremy Ashkenas
2d02a3cfb6 Fixes #861, better error message for adding invalid models to a collection. 2012-01-17 10:54:03 -05:00
Jeremy Ashkenas
7ba0275613 Fixes #574, clone 'models' before removing, so as to allow collection.remove(collection.models) 2012-01-17 10:29:01 -05:00
Brad Dunbar
9df6387d9e trigger all for each event 2012-01-13 18:58:11 -05:00
Jeremy Ashkenas
2dce413247 Adding options.index to Collection#add and #remove. 2012-01-13 17:20:15 -05:00
Jeremy Ashkenas
34e0f7fb26 Fixes #582, fixes #425, run a second loop to trigger change:attribute events after all changes have been made. 2012-01-13 17:08:48 -05:00
Jeremy Ashkenas
4316b04ffa allow the passing of any number of arguments to Model#initialize 2012-01-13 16:10:14 -05:00
Jeremy Ashkenas
5aa4fda9ba Fixes #640 -- adds the ability to bind/unbind/trigger (on/off/trigger) multiple, space separated events, after jQuery. 2012-01-13 16:01:59 -05:00
Jeremy Ashkenas
51335bf10f Fixes #641 -- on and off are now the preferred names for bind and unbind, following jQuery. 2012-01-13 15:27:57 -05:00
Jeremy Ashkenas
5b43cd9dd1 Fixes #419 -- add a global 'route' event, on Bacckbone.history. 2012-01-13 13:47:55 -05:00
Jeremy Ashkenas
a8bd142b64 Fixes #714, assign model.collection early, so that those overriding set() can use it from the get-go. 2012-01-13 13:19:28 -05:00
Brad Dunbar
47e1f7e6c8 (un)bind does not alter callback list during trigger 2012-01-13 08:24:47 -05:00
Jeremy Ashkenas
d5ff5e32f6 Fixes #786 (and others) -- leading slashes should never be defined as routes, or passed to navigate ... so strip 'em out proactively. 2012-01-12 18:10:41 -05:00
Jeremy Ashkenas
a49bb4f3e1 Fixes #811 -- allow you to pass a context when unbinding events as well. 2012-01-12 17:09:15 -05:00
Jeremy Ashkenas
93cb997fc3 removing overzealous events setting API. 2012-01-12 16:37:18 -05:00
Jeremy Ashkenas
feefb1c352 Merge pull request #815 from zowens/master
View Event Callbacks as Functions
2012-01-12 13:34:55 -08:00
Jeremy Ashkenas
4719659298 Fixes #841, adding upgrading jquery, classname --> class in the docs. 2012-01-12 15:26:46 -05:00