One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
define([ | |
"underscore", | |
"backbone", | |
"marionette", | |
"vent" | |
], | |
/** | |
* Creates the primary `Marionette.Application` object that runs the admin framework. Provides a central point | |
* from which all other sub-applications are started, shown, hidden, and stopped. |
debounce = (delay) -> | |
lastd = $.Deferred() | |
-> | |
lastd.reject() | |
d = $.Deferred() | |
lastd = d | |
args = arguments | |
setTimeout -> | |
d.resolve args | |
, delay || 100 |
function nestCollection(model, attributeName, nestedCollection) { | |
//setup nested references | |
for (var i = 0; i < nestedCollection.length; i++) { | |
model.attributes[attributeName][i] = nestedCollection.at(i).attributes; | |
} | |
//create empty arrays if none | |
nestedCollection.bind('add', function (initiative) { | |
if (!model.get(attributeName)) { | |
model.attributes[attributeName] = []; |