mirror of https://github.com/lidarr/Lidarr
Redirect to index when on series is deleted from details
This commit is contained in:
parent
57c876a420
commit
1bf855ca3a
|
@ -17,13 +17,14 @@ define(
|
||||||
},
|
},
|
||||||
|
|
||||||
removeSeries: function () {
|
removeSeries: function () {
|
||||||
|
var self = this;
|
||||||
var deleteFiles = this.ui.deleteFiles.prop('checked');
|
var deleteFiles = this.ui.deleteFiles.prop('checked');
|
||||||
|
|
||||||
this.model.destroy({
|
this.model.destroy({
|
||||||
data: { 'deleteFiles': deleteFiles },
|
data: { 'deleteFiles': deleteFiles },
|
||||||
wait: true
|
wait: true
|
||||||
}).done(function () {
|
}).done(function () {
|
||||||
|
App.vent.trigger(App.Events.SeriesDeleted, { series: self.model });
|
||||||
App.modalRegion.closeModal();
|
App.modalRegion.closeModal();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,8 @@ define(
|
||||||
this.model.on('sync', function () {
|
this.model.on('sync', function () {
|
||||||
this._setMonitoredState()
|
this._setMonitoredState()
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
|
this.listenTo(App.vent, App.Events.SeriesDeleted, this._onSeriesDeleted);
|
||||||
},
|
},
|
||||||
|
|
||||||
onShow: function () {
|
onShow: function () {
|
||||||
|
@ -127,6 +129,13 @@ define(
|
||||||
promise.always(function () {
|
promise.always(function () {
|
||||||
self.ui.refresh.removeClass('icon-spin');
|
self.ui.refresh.removeClass('icon-spin');
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
_onSeriesDeleted: function (event) {
|
||||||
|
|
||||||
|
if (this.model.get('id') === event.series.get('id')) {
|
||||||
|
App.Router.navigate('/', { trigger: true });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue