Andrew Humphreys
91d0824190
fix error when adding model to collection at an out of bounds index
2015-08-21 17:15:07 +01: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
Justin Ridgewell
a6e2f0fb54
Test null set doesn't clear model.
...
https://github.com/jashkenas/backbone/pull/3663#discussion_r36124174
2015-08-07 13:20:41 -04:00
John-David Dalton
0bc02af704
Use some, includes, map in tests instead of any, include, pluck.
2015-08-07 01:58:09 -07:00
Justin Ridgewell
f4d4557592
Setup DOM for every view test
...
Karma QUnit v0.1.5 now removes and reinserts the `#qunit-fixture`
element before every test.
2015-08-04 01:13:48 -04:00
Linus-A. M. Gubenis
d6dd17c1ee
typos
2015-07-13 09:50:11 -05:00
Linus-A. M. Gubenis
a37d30a3e1
Update collection.js
2015-07-13 09:43:55 -05:00
sophietk
0d43789682
Fix test for IE7/IE8 build
2015-06-24 10:25:45 +02: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
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
c40396228b
Fix incorrect test
2015-06-10 14:26:37 -04:00
jdalton
74427c9e76
Remove the only _.bindAll use.
2015-06-09 11:01:57 -07:00
Justin Ridgewell
0052c2fc5c
Keep backwards compatibility with v1
2015-06-03 20:59:59 -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
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
Andrey Kuzmin
ffa4fa597d
Added failing test case
2015-06-02 13:58:13 -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
f79e0bcf53
Fix failing IE6 test
...
It was a false positive. Our “location” parsing uses an A tag, which
doesn’t always work the way the real location parsing does.
2015-06-02 12:26:41 -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
13de636df1
Ensure fetch'd data is only parsed once
2015-05-30 02:27:51 -04:00
Justin Ridgewell
415c3a7a13
Collection#set shouldn't parse
...
Fixes #3636 , #2824 .
Reverts #1407 .
2015-05-30 02:27:51 -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
61e765087d
Test that Collection#remove _only_ returns removed models
...
Add (currently) failing tests for #3512 .
2015-05-27 11:42:42 -04:00
Jeremy Ashkenas
165034b861
Merge pull request #3628 from jridgewell/model-fetch-style
...
Model#fetch parse option
2015-05-26 17:34:04 -04:00
Justin Ridgewell
11071babd4
Test #setElement
2015-05-23 20:35:03 -04:00
Justin Ridgewell
00226d5a57
Test #remove returns view
2015-05-23 20:34:55 -04:00
Justin Ridgewell
dcbd0ea8e6
Test #undelegateEvents returns view
2015-05-23 20:34:32 -04:00
Justin Ridgewell
dc52dec96c
#undelegate returns view
2015-05-23 20:34:10 -04:00
Justin Ridgewell
fda1f62824
#delegate returns view
2015-05-23 20:33:35 -04:00
Justin Ridgewell
5c8c40fe37
Test #render returns view
2015-05-23 20:33:13 -04:00
Justin Ridgewell
0c2953a0d8
Respect parse option in Model#fetch
...
Expand #3508 to cover `Model#fetch`
2015-05-23 12:58:35 -04:00
Justin Ridgewell
dba0faad09
Collection#invoke should collect arguments
...
Fixes https://github.com/jashkenas/backbone/issues/3610 .
2015-05-15 20:26:58 -04:00
Justin Ridgewell
6ecee63738
Juggle context param with event maps
...
When using event maps, it's a little nicer to specify the `context`
parameter as the second argument. This keeps backwards compatibility,
though the feature wasn't documented.
```javascript
obj.on({
a: method,
b: other
}, context);
```
When you explicitly pass a `context`, we don't override.
```javascript
obj.on({
a: function() { ok(this === context); },
}, otherContext, context);
```
2015-05-13 20:41:51 -04:00
Jeremy Ashkenas
bc73e25c5e
Fixes #3512
2015-05-13 18:03:53 -04:00
Jeremy Ashkenas
a1c65e2420
s/updated/update
2015-05-13 17:39:05 -04:00
Jeremy Ashkenas
3150eec295
merged in 'updated'
2015-05-13 17:37:54 -04:00
Jeremy Ashkenas
6ef574669b
Merge pull request #3594 from jridgewell/eventsApi-refinements
...
Refine eventsApi
2015-05-13 16:11:31 -04:00
Adam Krebs
c731f721f3
Merge branch 'master' into bb-120
2015-05-13 11:59:33 -04:00
Jeremy Ashkenas
4aa539d3db
Merge pull request #3577 from jridgewell/destroy-zalgo
...
Always call success async
2015-05-13 11:19:39 -04:00
Adam Krebs
6ea3bfb665
merge in master branch
2015-05-13 11:10:03 -04:00
Justin Ridgewell
9ad11ddf80
Ensure #on and #off **never** alter callback list
2015-05-01 20:20:21 -04:00
Justin Ridgewell
020bec3b22
Refine eventsApi
...
Based off code from https://github.com/jashkenas/backbone/pull/3476
2015-05-01 20:20:21 -04:00
Brad Dunbar
1eb03c8354
Clean up.
2015-04-28 07:17:15 -04:00
Brad Dunbar
c8968853a2
Simplify.
2015-04-28 07:13:54 -04:00
Brad Dunbar
24daf350e4
Use more descriptive test names.
2015-04-28 06:56:40 -04:00
Brad Dunbar
21180e7234
Handle roots with regex characters.
2015-04-28 06:55:10 -04:00
Brad Dunbar
c1e70a28aa
If the root doesn't match, no routes can match.
2015-04-28 06:34:28 -04:00