|
|
@ -26,6 +26,9 @@ define(
|
|
|
|
|
|
|
|
|
|
|
|
initialize: function () {
|
|
|
|
initialize: function () {
|
|
|
|
this.mainView = new ButtonsView();
|
|
|
|
this.mainView = new ButtonsView();
|
|
|
|
|
|
|
|
this.releaseCollection = new ReleaseCollection();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.listenTo(this.releaseCollection, 'sync', this._showSearchResults);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
onShow: function () {
|
|
|
|
onShow: function () {
|
|
|
@ -55,20 +58,9 @@ define(
|
|
|
|
e.preventDefault();
|
|
|
|
e.preventDefault();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var self = this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.mainView = new LoadingView();
|
|
|
|
this.mainView = new LoadingView();
|
|
|
|
this._showMainView();
|
|
|
|
this._showMainView();
|
|
|
|
|
|
|
|
this.releaseCollection.fetchEpisodeReleases(this.model.id);
|
|
|
|
var releases = new ReleaseCollection();
|
|
|
|
|
|
|
|
var promise = releases.fetchEpisodeReleases(this.model.id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
promise.done(function () {
|
|
|
|
|
|
|
|
if (!self.isClosed) {
|
|
|
|
|
|
|
|
self.mainView = new ManualSearchLayout({collection: releases});
|
|
|
|
|
|
|
|
self._showMainView();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
_showMainView: function () {
|
|
|
|
_showMainView: function () {
|
|
|
@ -78,7 +70,11 @@ define(
|
|
|
|
_showButtons: function () {
|
|
|
|
_showButtons: function () {
|
|
|
|
this.mainView = new ButtonsView();
|
|
|
|
this.mainView = new ButtonsView();
|
|
|
|
this._showMainView();
|
|
|
|
this._showMainView();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_showSearchResults: function () {
|
|
|
|
|
|
|
|
this.mainView = new ManualSearchLayout({ collection: this.releaseCollection });
|
|
|
|
|
|
|
|
this._showMainView();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|