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