2013-03-06 21:30:53 +01:00
|
|
|
'use strict';
|
2013-06-22 02:48:23 +02:00
|
|
|
define(
|
|
|
|
[
|
|
|
|
'app',
|
2013-06-25 01:41:59 +02:00
|
|
|
'marionette'
|
|
|
|
], function (App, Marionette) {
|
2013-02-14 19:01:30 +01:00
|
|
|
|
2013-06-25 01:41:59 +02:00
|
|
|
return Marionette.ItemView.extend({
|
2013-06-22 02:48:23 +02:00
|
|
|
template: 'Series/Delete/DeleteSeriesTemplate',
|
2013-02-14 19:01:30 +01:00
|
|
|
|
2013-06-22 02:48:23 +02:00
|
|
|
events: {
|
|
|
|
'click .x-confirm-delete': 'removeSeries'
|
|
|
|
},
|
2013-02-14 19:01:30 +01:00
|
|
|
|
2013-06-22 02:48:23 +02:00
|
|
|
ui: {
|
|
|
|
deleteFiles: '.x-delete-files'
|
|
|
|
},
|
2013-02-14 19:01:30 +01:00
|
|
|
|
2013-06-22 02:48:23 +02:00
|
|
|
removeSeries: function () {
|
2013-02-15 03:40:29 +01:00
|
|
|
|
2013-06-22 02:48:23 +02:00
|
|
|
var deleteFiles = this.ui.deleteFiles.prop('checked');
|
2013-02-15 03:40:29 +01:00
|
|
|
|
2013-06-22 02:48:23 +02:00
|
|
|
this.model.destroy({
|
|
|
|
data: { 'deleteFiles': deleteFiles },
|
|
|
|
wait: true
|
|
|
|
}).done(function () {
|
2013-06-27 01:45:05 +02:00
|
|
|
App.modalRegion.closeModal();
|
2013-06-22 02:48:23 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
2013-02-14 19:01:30 +01:00
|
|
|
});
|