added release results to episode detail tab

This commit is contained in:
kay.one 2013-06-06 17:17:57 -07:00
parent a5be71fd8c
commit 890d1f2398
14 changed files with 191 additions and 48 deletions

View file

@ -1,5 +1,5 @@
"use strict";
define(['app', 'Episode/Summary/View'], function () {
define(['app', 'Shared/SpinnerView', 'Episode/Summary/View', 'Episode/Search/Layout', 'Release/Collection'], function () {
NzbDrone.Episode.Layout = Backbone.Marionette.Layout.extend({
template: 'Episode/LayoutTemplate',
@ -27,6 +27,7 @@ define(['app', 'Episode/Summary/View'], function () {
onShow: function () {
this.showSummary();
this._releaseSearchActivated = false;
},
@ -53,9 +54,23 @@ define(['app', 'Episode/Summary/View'], function () {
e.preventDefault();
}
if (this._releaseSearchActivated) {
return;
}
var self = this;
this.ui.search.tab('show');
this.search.show(new NzbDrone.Shared.SpinnerView());
var releases = new NzbDrone.Release.Collection();
var promise = releases.fetchEpisodeReleases(this.model.id);
promise.done(function () {
self.search.show(new NzbDrone.Episode.Search.Layout({collection: releases}));
});
}
});
});
});