Created
November 18, 2012 21:57
-
-
Save mattd/4107773 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
'vent', | |
'marionette', | |
'collections/widget', | |
'layouts/index', | |
'views/widget/collection' | |
], function ( | |
vent, | |
Marionette, | |
WidgetCollection, | |
IndexLayout, | |
WidgetCollectionView | |
) { | |
"use strict"; | |
return Marionette.Controller.extend({ | |
initialize: function (options) { | |
this.region = options.region; | |
}, | |
index: function () { | |
var layout = new IndexLayout(); | |
var collection = new WidgetCollection(); | |
this.region.show(layout); | |
layout.widgets.show( | |
new WidgetCollectionView({ | |
collection: collection | |
}) | |
); | |
collection.fetch(); | |
setInterval(function () { | |
vent.trigger('refresh:widgets'); | |
}, 1000); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment