sonarr-repo-only/UI/Series/Delete/DeleteSeriesView.js

35 lines
838 B
JavaScript
Raw Normal View History

2013-03-06 20:30:53 +00:00
'use strict';
define(['app', 'Series/SeriesModel'], function () {
2013-03-03 22:42:26 +00:00
NzbDrone.Series.Delete.DeleteSeriesView = Backbone.Marionette.ItemView.extend({
template: 'Series/Delete/DeleteSeriesTemplate',
events: {
'click .x-confirm-delete': 'removeSeries'
},
ui: {
deleteFiles: '.x-delete-files'
},
removeSeries: function () {
var deleteFiles = this.ui.deleteFiles.prop('checked');
this.model.destroy({
data : { 'deleteFiles': deleteFiles },
wait : true,
success: function (model) {
model.collection.remove(model);
}
});
NzbDrone.modalRegion.close();
}
});
2013-06-19 01:02:23 +00:00
return NzbDrone.Series.Delete.DeleteSeriesView;
});