2013-02-14 18:01:30 +00:00
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
define(['app', 'Series/SeriesModel'], function () {
|
|
|
|
|
|
|
|
|
|
NzbDrone.Series.DeleteSeriesView = Backbone.Marionette.ItemView.extend({
|
2013-02-15 02:40:29 +00:00
|
|
|
|
template:'Series/Delete/DeleteSeriesTemplate',
|
|
|
|
|
tagName:'div',
|
|
|
|
|
className:"modal",
|
2013-02-14 18:01:30 +00:00
|
|
|
|
|
2013-02-15 02:40:29 +00:00
|
|
|
|
events:{
|
|
|
|
|
'click .x-confirm-delete':'removeSeries'
|
2013-02-14 18:01:30 +00:00
|
|
|
|
},
|
|
|
|
|
|
2013-02-15 02:40:29 +00:00
|
|
|
|
ui:{
|
|
|
|
|
deleteFiles:'.x-delete-files'
|
2013-02-14 18:01:30 +00:00
|
|
|
|
},
|
|
|
|
|
|
2013-02-15 02:40:29 +00:00
|
|
|
|
onRender:function () {
|
2013-02-14 18:01:30 +00:00
|
|
|
|
NzbDrone.ModelBinder.bind(this.model, this.el);
|
|
|
|
|
},
|
|
|
|
|
|
2013-02-15 02:40:29 +00:00
|
|
|
|
removeSeries:function () {
|
|
|
|
|
|
|
|
|
|
var deleteFiles = this.ui.deleteFiles.prop('checked');
|
|
|
|
|
|
|
|
|
|
this.model.destroy({
|
|
|
|
|
data:{ 'deleteFiles':deleteFiles },
|
|
|
|
|
success:function (model) {
|
|
|
|
|
model.collection.remove(model);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
NzbDrone.modalRegion.close();
|
|
|
|
|
|
|
|
|
|
}
|
2013-02-14 18:01:30 +00:00
|
|
|
|
});
|
|
|
|
|
});
|