2013-03-06 23:30:53 +03:00
|
|
|
'use strict';
|
2013-02-14 21:01:30 +03:00
|
|
|
|
|
|
|
define(['app', 'Series/SeriesModel'], function () {
|
|
|
|
|
2013-03-04 01:42:26 +03:00
|
|
|
NzbDrone.Series.Delete.DeleteSeriesView = Backbone.Marionette.ItemView.extend({
|
2013-02-15 05:40:29 +03:00
|
|
|
template:'Series/Delete/DeleteSeriesTemplate',
|
|
|
|
tagName:'div',
|
|
|
|
className:"modal",
|
2013-02-14 21:01:30 +03:00
|
|
|
|
2013-02-15 05:40:29 +03:00
|
|
|
events:{
|
|
|
|
'click .x-confirm-delete':'removeSeries'
|
2013-02-14 21:01:30 +03:00
|
|
|
},
|
|
|
|
|
2013-02-15 05:40:29 +03:00
|
|
|
ui:{
|
|
|
|
deleteFiles:'.x-delete-files'
|
2013-02-14 21:01:30 +03:00
|
|
|
},
|
|
|
|
|
2013-02-15 05:40:29 +03:00
|
|
|
onRender:function () {
|
2013-02-14 21:01:30 +03:00
|
|
|
NzbDrone.ModelBinder.bind(this.model, this.el);
|
|
|
|
},
|
|
|
|
|
2013-02-15 05:40:29 +03: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 21:01:30 +03:00
|
|
|
});
|
|
|
|
});
|