|
|
@ -44,11 +44,7 @@ define(
|
|
|
|
initialize: function () {
|
|
|
|
initialize: function () {
|
|
|
|
$('body').addClass('backdrop');
|
|
|
|
$('body').addClass('backdrop');
|
|
|
|
|
|
|
|
|
|
|
|
this.listenTo(this.model, 'sync', function () {
|
|
|
|
this.listenTo(this.model, 'change:monitored', this._setMonitoredState);
|
|
|
|
this._setMonitoredState();
|
|
|
|
|
|
|
|
this._showInfo();
|
|
|
|
|
|
|
|
}, this);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.listenTo(App.vent, App.Events.SeriesDeleted, this._onSeriesDeleted);
|
|
|
|
this.listenTo(App.vent, App.Events.SeriesDeleted, this._onSeriesDeleted);
|
|
|
|
this.listenTo(App.vent, App.Events.SeasonRenamed, this._onSeasonRenamed);
|
|
|
|
this.listenTo(App.vent, App.Events.SeasonRenamed, this._onSeasonRenamed);
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -68,28 +64,27 @@ define(
|
|
|
|
this._showInfo();
|
|
|
|
this._showInfo();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
onRender: function(){
|
|
|
|
onRender: function () {
|
|
|
|
Actioneer.bindToCommand({
|
|
|
|
Actioneer.bindToCommand({
|
|
|
|
element: this.ui.refresh,
|
|
|
|
element: this.ui.refresh,
|
|
|
|
command: {
|
|
|
|
command: {
|
|
|
|
name : 'refreshSeries'
|
|
|
|
name: 'refreshSeries'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
Actioneer.bindToCommand({
|
|
|
|
Actioneer.bindToCommand({
|
|
|
|
element: this.ui.search,
|
|
|
|
element: this.ui.search,
|
|
|
|
command: {
|
|
|
|
command: {
|
|
|
|
name : 'seriesSearch'
|
|
|
|
name: 'seriesSearch'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
Actioneer.bindToCommand({
|
|
|
|
Actioneer.bindToCommand({
|
|
|
|
element: this.ui.rename,
|
|
|
|
element: this.ui.rename,
|
|
|
|
command: {
|
|
|
|
command: {
|
|
|
|
name : 'renameSeries'
|
|
|
|
name: 'renameSeries'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -116,22 +111,19 @@ define(
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
_toggleMonitored: function () {
|
|
|
|
_toggleMonitored: function () {
|
|
|
|
var name = 'monitored';
|
|
|
|
var savePromise = this.model.save('monitored', !this.model.get('monitored'), {
|
|
|
|
this.model.set(name, !this.model.get(name), { silent: true });
|
|
|
|
wait: true
|
|
|
|
|
|
|
|
|
|
|
|
Actioneer.SaveModel({
|
|
|
|
|
|
|
|
context: this,
|
|
|
|
|
|
|
|
element: this.ui.monitored,
|
|
|
|
|
|
|
|
always : this._setMonitoredState()
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.ui.monitored.spinForPromise(savePromise);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
_setMonitoredState: function () {
|
|
|
|
_setMonitoredState: function () {
|
|
|
|
var monitored = this.model.get('monitored');
|
|
|
|
var monitored = this.model.get('monitored');
|
|
|
|
|
|
|
|
|
|
|
|
this.ui.monitored.removeClass('icon-spin icon-spinner');
|
|
|
|
this.ui.monitored.removeAttr('data-idle-icon');
|
|
|
|
|
|
|
|
|
|
|
|
if (this.model.get('monitored')) {
|
|
|
|
if (monitored) {
|
|
|
|
this.ui.monitored.addClass('icon-nd-monitored');
|
|
|
|
this.ui.monitored.addClass('icon-nd-monitored');
|
|
|
|
this.ui.monitored.removeClass('icon-nd-unmonitored');
|
|
|
|
this.ui.monitored.removeClass('icon-nd-unmonitored');
|
|
|
|
}
|
|
|
|
}
|
|
|
|