Commit Graph

1465 Commits

Author SHA1 Message Date
Adam Krebs
3edf74c37b return this from delegate 2014-03-04 13:42:42 +02:00
Jimmy Yuen Ho Wong
5dc2d093fb Call _createContext only once during new View 2014-03-04 13:42:42 +02:00
Adam Krebs
72b88b5835 Revert "Speed up method calls in delegateEvents and delegate"
This reverts commit 846de91c88.

Conflicts:
	backbone.js
2014-03-04 13:42:41 +02:00
Jimmy Yuen Ho Wong
12abe8eef6 Comment for 2 arg form inside _delegate 2014-03-04 13:42:41 +02:00
Jimmy Yuen Ho Wong
25c0beed0f Fix typo 2014-03-04 13:42:41 +02:00
Jimmy Yuen Ho Wong
9868bfb862 No reason jQuery can't be a little faster too 2014-03-04 13:42:41 +02:00
Jimmy Yuen Ho Wong
390275b82f Fix comment 2014-03-04 13:42:41 +02:00
Jimmy Yuen Ho Wong
18d17db554 Disallow chaining in hook calls 2014-03-04 13:42:41 +02:00
Jimmy Yuen Ho Wong
6ebb6e1752 _createContext is side-effect only 2014-03-04 13:42:41 +02:00
Jimmy Yuen Ho Wong
9028e338c3 Shortened _createContext 2014-03-04 13:42:41 +02:00
Jimmy Yuen Ho Wong
1e9cd4a350 Revert introduction of _undelegate 2014-03-04 13:42:41 +02:00
Jimmy Yuen Ho Wong
d78fb34aff Prefix all hooks with _ and introduce _undelegate 2014-03-04 13:42:40 +02:00
Jimmy Yuen Ho Wong
5f66f9af18 Rename make to _createContext and have _ensureElement and setElement delegate to it 2014-03-04 13:42:40 +02:00
Jimmy Yuen Ho Wong
ad44cb41b6 Further isolate $.remove by exposing removeElement in case subclasses forgot to clean up 2014-03-04 13:42:40 +02:00
Jimmy Yuen Ho Wong
3369bf486b Speed up method calls in delegateEvents and delegate 2014-03-04 13:42:40 +02:00
Jimmy Yuen Ho Wong
be1cba3331 Move delegate up and move check into undelegateEvents 2014-03-04 13:42:40 +02:00
Adam Krebs
4e5b28221c save two lines in View#make: jquery handles nulls nicely 2014-03-04 13:42:40 +02:00
Adam Krebs
90c36cadac add View#delegate as a single event listener version of delegateEvents for easier overriding 2014-03-04 13:42:40 +02:00
Adam Krebs
0cdb38b03f revert c1e62cda: add View#make back in for overriding 2014-03-04 13:42:40 +02:00
Jeremy Ashkenas
36e4925b9c #2985 -- use 'change-id' as the event name 2014-03-03 13:00:04 -05:00
Jeremy Ashkenas
60b9cc1d18 Merge pull request #2985 from caseywebdev/generate-id
Re #2976 Allow `id` values to be generated from a function given attrs
2014-03-03 12:56:08 -05:00
Adam Krebs
16e548397e pass along model and comparator to cloned collection. Fixes #3013 2014-03-02 23:13:17 +02:00
brad dunbar
bdc5c63944 Merge pull request #3029 from Crisfole/update/underscore
Add new `_.partition`
2014-02-28 13:59:42 -05:00
Casey Foster
83c81005fe Re #3029 Guard against unavailable edge underscore proxies 2014-02-28 12:26:26 -06:00
Christopher Pfohl
fa7e617edf Add new _.partition 2014-02-28 08:50:09 -05:00
Jeremy Ashkenas
1853297cc9 Merge pull request #3006 from akre54/history-native-hooks
History native calls
2014-02-27 13:05:33 -05:00
Casey Foster
5bc7333a2a Re #2976 Allow id values to be generated from a function given attrs 2014-02-27 10:55:53 -06:00
Brad Dunbar
49123e9ab1 Don't be clever. 2014-02-26 17:05:50 -05:00
Brad Dunbar
e6fc18f299 A facelift for Events#off.
* Reduce nesting by bailing out early when there is no action to take.
* Rename abbreviated variables for readability.
* Add comments and spacing.
2014-02-26 16:31:11 -05:00
Brad Dunbar
64ff32f492 More consistency in loops. 2014-02-26 14:51:35 -05:00
Brad Dunbar
2e82a1e638 A little cleanup of Collection#set.
* Remove variable with only one reference.
* Consistent loops.
* Use `#slice` instead of clone when guaranteed array.
2014-02-25 22:22:38 -05:00
Ville Lautanala
a31d86390b Check that model exists before trying to verify uniqueness
When calling fetch with {add: false} and model does not exist in
collection, model uniqueness check tries to access id of undefined. This
verifies that model is set before checking for existing models.
2014-02-25 01:18:58 +02:00
Brad Dunbar
e88d34dd18 Tweak a bit. 2014-02-22 13:30:21 -05:00
Jimmy Yuen Ho Wong
674f101ad8 Create iframe conditional on options and hashchange and pushstate support 2014-02-22 22:48:18 +08:00
Maksim Horbachevsky
520218769b Do not trigger router/history events if Router#execute returns false 2014-02-22 17:46:02 +03:00
Brad Dunbar
f9f7131a06 Add documentation to the iframe approach. 2014-02-21 11:23:49 -05:00
Brad Dunbar
8dc036c324 Add a comment about clearInterval. 2014-02-20 17:35:38 -05:00
Jeremy Ashkenas
53f77901a4 Backbone 1.1.2 2014-02-20 16:34:01 -05:00
Jeremy Ashkenas
01f7f9b4c7 fixes #3004, edge case for titanium 2014-02-20 16:26:27 -05:00
Brad Dunbar
b1bcf0a9c0 Remove onpopstate check. 2014-02-20 06:17:30 -05:00
Brad Dunbar
5b49aae75f Handle newlines in route params. 2014-02-20 05:53:34 -05:00
Adam Krebs
feeab3faa6 Merge pull request #4 from braddunbar/history
Check `documentMode` and combine checks.
2014-02-19 23:59:11 -05:00
Adam Krebs
91ef885137 improve inline comments 2014-02-19 23:56:49 -05:00
Brad Dunbar
2c50dc52e8 Check documentMode and combine checks. 2014-02-19 11:30:11 -05:00
Brad Dunbar
18e15e2a9a Remove isExplorer RegEx. 2014-02-19 10:43:15 -05:00
Brad Dunbar
87dce15d3c Pass useCapture to removeEventListener. 2014-02-19 10:28:26 -05:00
Brad Dunbar
573070fde9 Remove _oldIE variable.
* No need for `_oldIE` when we can just use `this.iframe`.
* Added `this._hasHashchange`.
2014-02-19 10:19:42 -05:00
Adam Krebs
4ab05ad5ff check for onpopstate in window instead of window.onpopstate 2014-02-19 09:14:38 -05:00
Adam Krebs
5d305bf72b remove first window argument from add/removeEventListener 2014-02-19 09:14:38 -05:00
Adam Krebs
0101416800 cleanup oldIE sniff code and iframe creation per @jdalton 2014-02-19 09:14:36 -05:00