2013-02-10 03:42:44 +00:00
|
|
|
|
'use strict';
|
|
|
|
|
/*global NzbDrone, Backbone*/
|
|
|
|
|
/// <reference path="../app.js" />
|
|
|
|
|
/// <reference path="SeriesModel.js" />
|
|
|
|
|
|
|
|
|
|
NzbDrone.Series.DeleteSeriesView = Backbone.Marionette.ItemView.extend({
|
|
|
|
|
template: 'Series/DeleteSeriesTemplate',
|
|
|
|
|
tagName: 'div',
|
|
|
|
|
className: "modal",
|
|
|
|
|
|
|
|
|
|
ui: {
|
|
|
|
|
'progressbar': '.progress .bar',
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
events: {
|
|
|
|
|
'click .x-confirm-delete': 'removeSeries',
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onRender: function () {
|
|
|
|
|
NzbDrone.ModelBinder.bind(this.model, this.el);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
removeSeries: function () {
|
2013-02-10 10:28:56 +00:00
|
|
|
|
//Todo: why the fuck doesn't destroy send the ID?
|
|
|
|
|
this.model.destroy({ wait: true, headers: { id: this.model.get('id'), deleteFiles: $('#delete-from-disk').prop('checked') } });
|
2013-02-10 03:42:44 +00:00
|
|
|
|
this.model.collection.remove(this.model);
|
|
|
|
|
this.$el.parent().modal('hide');
|
|
|
|
|
},
|
|
|
|
|
});
|