mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
removed NzbDrone. namespace, everything is done using require.
This commit is contained in:
parent
ef62af75df
commit
b0bd3f34f1
121 changed files with 2570 additions and 2587 deletions
|
@ -1,78 +1,85 @@
|
|||
'use strict';
|
||||
define(['app', 'Shared/SpinnerView', 'Episode/Summary/View', 'Episode/Search/Layout', 'Release/Collection'], function () {
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Episode/Summary/View',
|
||||
'Episode/Search/Layout',
|
||||
'Release/Collection',
|
||||
'Shared/SpinnerView'
|
||||
], function (Marionette, SummaryView, SearchLayout, ReleaseCollection, SpinnerView) {
|
||||
|
||||
NzbDrone.Episode.Layout = Backbone.Marionette.Layout.extend({
|
||||
template: 'Episode/LayoutTemplate',
|
||||
return Marionette.Layout.extend({
|
||||
template: 'Episode/LayoutTemplate',
|
||||
|
||||
|
||||
regions: {
|
||||
summary : '#episode-summary',
|
||||
activity: '#episode-activity',
|
||||
search : '#episode-search'
|
||||
},
|
||||
regions: {
|
||||
summary : '#episode-summary',
|
||||
activity: '#episode-activity',
|
||||
search : '#episode-search'
|
||||
},
|
||||
|
||||
ui: {
|
||||
summary : '.x-episode-summary',
|
||||
activity: '.x-episode-activity',
|
||||
search : '.x-episode-search'
|
||||
},
|
||||
ui: {
|
||||
summary : '.x-episode-summary',
|
||||
activity: '.x-episode-activity',
|
||||
search : '.x-episode-search'
|
||||
},
|
||||
|
||||
events: {
|
||||
events: {
|
||||
|
||||
'click .x-episode-summary' : 'showSummary',
|
||||
'click .x-episode-activity': 'showActivity',
|
||||
'click .x-episode-search' : 'showSearch'
|
||||
},
|
||||
'click .x-episode-summary' : 'showSummary',
|
||||
'click .x-episode-activity': 'showActivity',
|
||||
'click .x-episode-search' : 'showSearch'
|
||||
},
|
||||
|
||||
|
||||
onShow: function () {
|
||||
this.showSummary();
|
||||
this._releaseSearchActivated = false;
|
||||
},
|
||||
onShow: function () {
|
||||
this.showSummary();
|
||||
this._releaseSearchActivated = false;
|
||||
},
|
||||
|
||||
|
||||
showSummary: function (e) {
|
||||
if (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
this.ui.summary.tab('show');
|
||||
this.summary.show(new NzbDrone.Episode.Summary.View({model: this.model}));
|
||||
|
||||
},
|
||||
|
||||
showActivity: function (e) {
|
||||
if (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
this.ui.activity.tab('show');
|
||||
},
|
||||
|
||||
showSearch: function (e) {
|
||||
if (e) {
|
||||
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 () {
|
||||
if (!self.isClosed) {
|
||||
self.search.show(new NzbDrone.Episode.Search.Layout({collection: releases}));
|
||||
showSummary: function (e) {
|
||||
if (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.ui.summary.tab('show');
|
||||
this.summary.show(new SummaryView({model: this.model}));
|
||||
|
||||
},
|
||||
|
||||
showActivity: function (e) {
|
||||
if (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
this.ui.activity.tab('show');
|
||||
},
|
||||
|
||||
showSearch: function (e) {
|
||||
if (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
if (this._releaseSearchActivated) {
|
||||
return;
|
||||
}
|
||||
|
||||
var self = this;
|
||||
|
||||
this.ui.search.tab('show');
|
||||
this.search.show(new SpinnerView());
|
||||
|
||||
var releases = new ReleaseCollection();
|
||||
var promise = releases.fetchEpisodeReleases(this.model.id);
|
||||
|
||||
promise.done(function () {
|
||||
if (!self.isClosed) {
|
||||
self.search.show(new SearchLayout({collection: releases}));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue