From a15fb00c350a87b35574b859af3e601f263893ba Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Tue, 31 Dec 2013 00:43:01 -0800 Subject: [PATCH] sync event instead of promise --- src/UI/System/Update/UpdateLayout.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/UI/System/Update/UpdateLayout.js b/src/UI/System/Update/UpdateLayout.js index 026170265..eea1a7098 100644 --- a/src/UI/System/Update/UpdateLayout.js +++ b/src/UI/System/Update/UpdateLayout.js @@ -16,17 +16,18 @@ define( initialize: function () { this.updateCollection = new UpdateCollection(); + + this.listenTo(this.updateCollection, 'sync', this._showUpdates); }, onRender: function () { this.updates.show(new LoadingView()); - var self = this; - var promise = this.updateCollection.fetch(); + this.updateCollection.fetch(); + }, - promise.done(function (){ - self.updates.show(new UpdateCollectionView({ collection: self.updateCollection })); - }); + _showUpdates: function () { + this.updates.show(new UpdateCollectionView({ collection: this.updateCollection })); } }); });