2017-09-11 09:41:17 +02:00
|
|
|
import ModalComponent from 'ghost-admin/components/modal-base';
|
2017-08-22 09:53:26 +02:00
|
|
|
import {alias} from '@ember/object/computed';
|
2017-01-19 12:40:31 +01:00
|
|
|
import {task} from 'ember-concurrency';
|
2016-08-17 17:01:46 +02:00
|
|
|
|
|
|
|
export default ModalComponent.extend({
|
2018-03-20 15:57:59 +01:00
|
|
|
// Allowed actions
|
|
|
|
confirm: () => {},
|
2016-08-17 17:01:46 +02:00
|
|
|
|
|
|
|
theme: alias('model.theme'),
|
|
|
|
download: alias('model.download'),
|
|
|
|
|
2018-01-11 18:43:23 +01:00
|
|
|
actions: {
|
|
|
|
confirm() {
|
2019-03-06 14:53:54 +01:00
|
|
|
this.deleteTheme.perform();
|
2018-01-11 18:43:23 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2017-01-19 12:40:31 +01:00
|
|
|
deleteTheme: task(function* () {
|
|
|
|
try {
|
2018-03-20 15:57:59 +01:00
|
|
|
yield this.confirm();
|
2017-01-19 12:40:31 +01:00
|
|
|
} finally {
|
|
|
|
this.send('closeModal');
|
|
|
|
}
|
2018-01-11 18:43:23 +01:00
|
|
|
}).drop()
|
2016-08-17 17:01:46 +02:00
|
|
|
});
|