You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
868 B
JavaScript
33 lines
868 B
JavaScript
define([
|
|
"jquery" , "underscore" , "class",
|
|
"models/snippets",
|
|
"collections/snippets",
|
|
"views/my-form-snippet"
|
|
], function(
|
|
$, _, Class,
|
|
SnippetModel,
|
|
SnippetsCollection,
|
|
MyFormSnippetView
|
|
){
|
|
return SnippetsCollection.extend({
|
|
model: SnippetModel,
|
|
|
|
renderAll: function(){
|
|
var that = this;
|
|
return this.map(function(snippet){
|
|
return new MyFormSnippetView({model: new SnippetModel(snippet),
|
|
parentModel: that,
|
|
}).render(true);
|
|
})
|
|
},
|
|
|
|
renderAllClean: function(){
|
|
var that = this;
|
|
return this.map(function(snippet){
|
|
return new MyFormSnippetView({model: new SnippetModel(snippet),
|
|
parentModel: that,
|
|
}).render(false);
|
|
});
|
|
}
|
|
});
|
|
}); |