Commit Graph

428 Commits

Author SHA1 Message Date
Jeremy Ashkenas
42d321f236 Fixes #570, supports Model#save(key, value) 2012-01-17 11:55:15 -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
Jeremy Ashkenas
ff176ac61f reverting previous change (#859) 2012-01-17 10:17:42 -05:00
Jeremy Ashkenas
05a45d3e9d Merge pull request #859 from ekratskih/master
Cross domain issue patch for old ie browsers (<=7)
2012-01-17 07:09:55 -08:00
Edil Kratskih
07ba2d5398 Simple refactoring 2012-01-16 13:10:34 +06:00
Brad Dunbar
9df6387d9e trigger all for each event 2012-01-13 18:58:11 -05:00
Jeremy Ashkenas
9c0e7f00ea Merge pull request #857 from braddunbar/events-documentation
Documentation for Backbone.Events
2012-01-13 14:25:27 -08:00
Jeremy Ashkenas
2dce413247 Adding options.index to Collection#add and #remove. 2012-01-13 17:20:15 -05:00
Brad Dunbar
920d047145 Documentation for Backbone.Events 2012-01-13 17:16:53 -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
3f0979f09a Fixes #593 -- pass complete options to model constructor on create() 2012-01-13 16:56:12 -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
b28a24207a fixes #651 -- always clone options. 2012-01-13 14:30:43 -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
a78be62684 Fixes #702: adds 'initial' and 'shuffle' to Backbone collections. 2012-01-13 13:30:53 -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
Jeremy Ashkenas
837f774fd8 lint/style tweaks to prev commit. 2012-01-13 11:07:38 -05:00
Jeremy Ashkenas
159e51e860 Merge pull request #723 from braddunbar/bind-during-trigger
(un)bind does not alter callback list during trigger
2012-01-13 08:03:04 -08:00
Jeremy Ashkenas
8c03df50c3 Fixes #783 -- adds a 'sync' event, fired whenever a successful call has been made to update the server. 2012-01-13 10:57:51 -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
328cb66638 Fixes #803, allows you to opt-out of hashchange, while opting-in to push state, using full-page refreshes for old browsers. 2012-01-12 17:44:45 -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
d514f2b4dc fixes #814 -- load initial models after Collection#initialize, not before. 2012-01-12 16:46:27 -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
88e6b32b51 Fixes #822, change comment to avoid 'confusing' reference to super 2012-01-12 16:18:15 -05:00
Jeremy Ashkenas
cee62e6541 Fixes #826 -- expose Backbone.wrapError. 2012-01-12 16:05:53 -05:00
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
Brad Dunbar
4dd506c3d4 more descriptive variable name 2012-01-11 18:25:17 -05:00
Brad Dunbar
f329cbffe4 only increment length once 2012-01-11 17:37:51 -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
933469a2bd Merge pull request #851 from mickeyreiss/master
Switch order of delegateEvents and initialize in View constructor
2012-01-11 09:04:49 -08:00
Brad Dunbar
c8919c4b05 collection.add should not alter models array 2012-01-10 17:18:11 -05:00
Brad Dunbar
61b277937e no need to _.bindAll _onModelEvent 2012-01-10 07:16:53 -05:00
Mickey Reiss
478aaf3d00 Switched order of delegateEvents and initialize in Backbone.View constructor in order to allow for explicit setting of this.el in initialize (and ensure that events are bound correctly). 2012-01-09 13:49:32 -05:00
Zack Owens
cd18a968d2 adding docs for events function 2012-01-07 10:19:18 -05:00
Zack Owens
b081fe87a5 view events can now be a function that returns an events object 2012-01-07 10:17:57 -05:00
Brad Dunbar
1ffae591c8 only call splice once instead of on each add 2012-01-06 19:37:38 -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
44bb57a217 being a bit stricter about comment wrapping at 80 chars. 2012-01-06 14:13:49 -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