Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
rivets-backbone-adapter-brainfood
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
f4048f8f
authored
2016-06-21 14:55:02 -0500
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Add an iterate() api call, that handles both Model and Collection.
1 parent
c4e53ec5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
src/scripts/rivets-backbone-adapter-brainfood.js
src/scripts/rivets-backbone-adapter-brainfood.js
View file @
f4048f8
...
...
@@ -57,6 +57,13 @@ define(function(require) {
}
}
},
iterate
:
function
iterate
(
obj
,
callback
,
context
)
{
if
(
obj
instanceof
Model
)
{
obj
.
each
(
callback
,
context
);
}
else
if
(
obj
instanceof
Collection
)
{
obj
.
each
(
callback
,
context
);
}
},
};
})(
Backbone
.
Model
,
Backbone
.
Collection
,
'add remove reset sort'
);
return
adapter
;
...
...
Please
register
or
sign in
to post a comment