2016-08-17 17:01:46 +02:00
|
|
|
import ModalComponent from 'ghost-admin/components/modals/base';
|
|
|
|
import {alias} from 'ember-computed';
|
|
|
|
import {invokeAction} from 'ember-invoke-action';
|
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({
|
|
|
|
|
|
|
|
theme: alias('model.theme'),
|
|
|
|
download: alias('model.download'),
|
|
|
|
|
2017-01-19 12:40:31 +01:00
|
|
|
deleteTheme: task(function* () {
|
|
|
|
try {
|
|
|
|
yield invokeAction(this, 'confirm');
|
|
|
|
} finally {
|
|
|
|
this.send('closeModal');
|
|
|
|
}
|
|
|
|
}).drop(),
|
|
|
|
|
2016-08-17 17:01:46 +02:00
|
|
|
actions: {
|
|
|
|
confirm() {
|
2017-01-19 12:40:31 +01:00
|
|
|
this.get('deleteTheme').perform();
|
2016-08-17 17:01:46 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|