2013-03-06 20:30:53 +00:00
|
|
|
'use strict';
|
2013-02-14 18:01:30 +00:00
|
|
|
define(['app', 'Series/SeriesModel'], function () {
|
|
|
|
|
2013-03-03 22:42:26 +00:00
|
|
|
NzbDrone.Series.Delete.DeleteSeriesView = Backbone.Marionette.ItemView.extend({
|
2013-03-29 23:28:58 +00:00
|
|
|
template : 'Series/Delete/DeleteSeriesTemplate',
|
|
|
|
tagName : 'div',
|
|
|
|
className: "modal",
|
2013-02-14 18:01:30 +00:00
|
|
|
|
2013-03-29 23:28:58 +00:00
|
|
|
events: {
|
|
|
|
'click .x-confirm-delete': 'removeSeries'
|
2013-02-14 18:01:30 +00:00
|
|
|
},
|
|
|
|
|
2013-03-29 23:28:58 +00:00
|
|
|
ui: {
|
|
|
|
deleteFiles: '.x-delete-files'
|
2013-02-14 18:01:30 +00:00
|
|
|
},
|
|
|
|
|
2013-03-29 23:28:58 +00:00
|
|
|
removeSeries: function () {
|
2013-02-15 02:40:29 +00:00
|
|
|
|
|
|
|
var deleteFiles = this.ui.deleteFiles.prop('checked');
|
|
|
|
|
|
|
|
this.model.destroy({
|
2013-03-29 23:28:58 +00:00
|
|
|
data : { 'deleteFiles': deleteFiles },
|
|
|
|
success: function (model) {
|
2013-02-15 02:40:29 +00:00
|
|
|
model.collection.remove(model);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
NzbDrone.modalRegion.close();
|
|
|
|
|
|
|
|
}
|
2013-02-14 18:01:30 +00:00
|
|
|
});
|
2013-04-24 05:56:51 +00:00
|
|
|
});
|