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-05-21 01:45:16 +03:00
|
|
|
template: 'Series/Delete/DeleteSeriesTemplate',
|
2013-02-14 21:01:30 +03:00
|
|
|
|
2013-03-30 02:28:58 +03:00
|
|
|
events: {
|
|
|
|
'click .x-confirm-delete': 'removeSeries'
|
2013-02-14 21:01:30 +03:00
|
|
|
},
|
|
|
|
|
2013-03-30 02:28:58 +03:00
|
|
|
ui: {
|
|
|
|
deleteFiles: '.x-delete-files'
|
2013-02-14 21:01:30 +03:00
|
|
|
},
|
|
|
|
|
2013-03-30 02:28:58 +03:00
|
|
|
removeSeries: function () {
|
2013-02-15 05:40:29 +03:00
|
|
|
|
|
|
|
var deleteFiles = this.ui.deleteFiles.prop('checked');
|
|
|
|
|
|
|
|
this.model.destroy({
|
2013-03-30 02:28:58 +03:00
|
|
|
data : { 'deleteFiles': deleteFiles },
|
2013-05-21 01:45:16 +03:00
|
|
|
wait : true,
|
2013-03-30 02:28:58 +03:00
|
|
|
success: function (model) {
|
2013-02-15 05:40:29 +03:00
|
|
|
model.collection.remove(model);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
NzbDrone.modalRegion.close();
|
|
|
|
|
|
|
|
}
|
2013-02-14 21:01:30 +03:00
|
|
|
});
|
2013-04-24 08:56:51 +03:00
|
|
|
});
|