1447 Commits

Author SHA1 Message Date
Jeremy Ashkenas
00f8b6fe79 Backbone.js 1.2.2 2015-08-19 15:03:44 -04:00
Jeremy Ashkenas
09fca1dc7e Merge pull request #3663 from jridgewell/collection-set-style-compat
Collection#set style (Backwards Compatible)
2015-08-18 17:35:20 -04:00
John-David Dalton
1f29c6713a Add Modernizr style check for 'onhashchange' to avoid issues in IE compat modes. [closes #3730] 2015-08-10 12:55:41 -07:00
Graeme Yeates
a2763083c6 Merge pull request #3676 from jridgewell/collection-includes
Add Collection#includes for underscore v1.8
2015-08-06 21:17:43 -04:00
John-David Dalton
7dc9708cc1 Use _.bind instead of context param of _.sortBy. 2015-08-03 13:52:51 -07:00
Justin Ridgewell
376249e46b Add Collection#includes for underscore v1.8 2015-08-03 16:35:15 -04:00
Justin Ridgewell
f55b4a2245 Merge pull request #3680 from akre54/multi-event-maps
Event maps should support multiple event syntax
2015-06-18 10:21:50 -04:00
Adam Krebs
28ea4b7785 fix addMethod examples 2015-06-12 15:12:15 -04:00
Adam Krebs
adf13ce852 Reorganize addUnderscoreMethods logic 2015-06-12 13:58:38 -04:00
Justin Ridgewell
b60b7da710 modelProperty doesn't need to check for null
Since `#models` is filled with only model instances, there's no need to
check if model isn't `null`.

re: #3667.
2015-06-12 13:28:55 -04:00
sophietk
007a1b85f4 Collection methods from underscore (reject, filter, some, every, ...) take function, set of model attributes, or attribute name as argument
- Expand the use of inherited underscore methods, to iteratee as function, object or string
- Apply iteratee transformation to groupBy, countBy, sortBy, indexBy
2015-06-11 18:04:30 +02:00
Adam Krebs
6b927eb5e7 Event maps should support multiple event syntax 2015-06-10 17:33:03 -04:00
Justin Ridgewell
a3a0484156 Merge pull request #3679 from akre54/doc-improvements
Update comments throughout the code
2015-06-10 15:32:46 -04:00
Adam Krebs
2be220f28f Update comments throughout the code 2015-06-10 14:26:01 -04:00
Justin Ridgewell
c86de5b72b Use some instead of any 2015-06-10 14:18:36 -04:00
Justin Ridgewell
dce3bdb16e Merge pull request #3646 from jashkenas/model-set-id-update
Update model's id with #get
2015-06-10 11:27:47 -04:00
jdalton
c23f6132c0 Replace _.any with _.some. 2015-06-09 21:44:17 -07:00
jdalton
74427c9e76 Remove the only _.bindAll use. 2015-06-09 11:01:57 -07:00
Jeremy Ashkenas
938a8ff934 Backbone 1.2.1 2015-06-04 18:09:12 -04:00
Justin Ridgewell
6215000047 Ungolf #create assignment 2015-06-03 21:58:53 -04:00
Justin Ridgewell
d1cc8b799c Use a simple slice 2015-06-03 21:29:57 -04:00
Justin Ridgewell
0052c2fc5c Keep backwards compatibility with v1 2015-06-03 20:59:59 -04:00
Justin Ridgewell
9a15fcff8b Use a splicing for-loop for stabler performance
- [Base case (`#unshift`)](http://jsperf.com/insert-array-into-another-array/6)
- ["Normal" collection size](http://jsperf.com/insert-array-into-another-array/8)
- [Large collection](http://jsperf.com/insert-array-into-another-array/7)
2015-06-03 02:53:41 -04:00
Justin Ridgewell
7ba78fe66d Remove unnecessary options clone 2015-06-03 02:53:41 -04:00
Justin Ridgewell
203052e164 Do not update models if nothing is set 2015-06-03 02:53:41 -04:00
Justin Ridgewell
198726d498 Make adding models with at **orders** faster
Splicing in a loop is the worst thing you can do:
http://jsperf.com/insert-array-into-another-array/4
2015-06-03 02:53:40 -04:00
Justin Ridgewell
a082d2fdf9 Return only added or merged models
Mirrors the change in #3512.
2015-06-03 02:53:40 -04:00
Justin Ridgewell
c105cc200f Invert conditional 2015-06-03 02:53:40 -04:00
Justin Ridgewell
e42e3118ac Invert ternary 2015-06-03 02:53:40 -04:00
Justin Ridgewell
7902a2f13f Golf assignment 2015-06-03 02:53:40 -04:00
Justin Ridgewell
496d083888 Ungolf assignments 2015-06-03 02:53:40 -04:00
Justin Ridgewell
1b8c9b4627 Declare variables as they are used 2015-06-03 02:53:40 -04:00
Justin Ridgewell
e81474880b Don't bother with Collection#set unless models 2015-06-03 02:52:57 -04:00
Justin Ridgewell
fdea29dfc8 Collection#add shouldn't parse a model instance
Fixes #3636, but in a backwards compatible way.
2015-06-02 14:06:50 -04:00
Justin Ridgewell
c95d9775e7 Revert "Merge pull request #3644 from jridgewell/collection-parse"
This reverts commit ff57b54cbb, reversing
changes made to 5ea158506f.
2015-06-02 13:55:21 -04:00
Jeremy Ashkenas
ff57b54cbb Merge pull request #3644 from jridgewell/collection-parse
Collection parse
2015-06-02 13:29:58 -04:00
Justin Ridgewell
1c6b7639ff Merge pull request #3613 from ahumphreys87/jsdomRouter
Fix opening and closing iframe document in jsdom
2015-06-02 11:09:47 -04:00
Justin Ridgewell
80ef9d5fef Merge pull request #3655 from akre54/code-reorg
Code reorg
2015-06-01 12:02:20 -04:00
Adam Krebs
9be4131258 fix typo in once comment 2015-06-01 11:53:10 -04:00
Adam Krebs
565b2a1952 Move addUnderscoreMethods out of Backbone.Events, adjust comment now that array methods is only 1 method 2015-06-01 11:36:43 -04:00
Justin Ridgewell
cac05d4192 Merge pull request #3647 from jridgewell/collection-removeModels
Remove unnecessary assignment
2015-06-01 10:38:57 -04:00
Justin Ridgewell
a41a2056f9 Merge pull request #3603 from jridgewell/event-map-context
Juggle context param with event maps
2015-06-01 10:29:14 -04:00
Justin Ridgewell
53a4e701bb Remove unnecessary assignment 2015-05-31 01:54:37 -04:00
Justin Ridgewell
be7fc95964 Update model's id with #get 2015-05-31 00:34:12 -04:00
Justin Ridgewell
1a8ed2efc6 Variable cleanup 2015-05-30 23:13:02 -04:00
Justin Ridgewell
415c3a7a13 Collection#set shouldn't parse
Fixes #3636, #2824.

Reverts #1407.
2015-05-30 02:27:51 -04:00
Graeme Yeates
dbcfc15b8a Merge pull request #3639 from jridgewell/collection-removeModels
Fix syntax error
2015-05-27 11:55:40 -04:00
Justin Ridgewell
196cee7289 Fix syntax error. 2015-05-27 11:53:37 -04:00
Jeremy Ashkenas
2e465970e0 Merge pull request #3637 from jridgewell/collection-removeModels
Return removed models from #_removeModels
2015-05-27 11:49:44 -04:00
Justin Ridgewell
e926394658 #_removeReference now removes references 2015-05-27 11:44:27 -04:00