2017-09-11 10:41:17 +03:00
|
|
|
import ModalComponent from 'ghost-admin/components/modal-base';
|
2017-08-22 10:53:26 +03:00
|
|
|
import {alias} from '@ember/object/computed';
|
2016-08-17 18:01:46 +03:00
|
|
|
import {invokeAction} from 'ember-invoke-action';
|
2017-01-19 14:40:31 +03:00
|
|
|
import {task} from 'ember-concurrency';
|
2016-08-17 18:01:46 +03:00
|
|
|
|
|
|
|
export default ModalComponent.extend({
|
|
|
|
|
|
|
|
theme: alias('model.theme'),
|
|
|
|
download: alias('model.download'),
|
|
|
|
|
2017-01-19 14:40:31 +03:00
|
|
|
deleteTheme: task(function* () {
|
|
|
|
try {
|
|
|
|
yield invokeAction(this, 'confirm');
|
|
|
|
} finally {
|
|
|
|
this.send('closeModal');
|
|
|
|
}
|
|
|
|
}).drop(),
|
|
|
|
|
2016-08-17 18:01:46 +03:00
|
|
|
actions: {
|
|
|
|
confirm() {
|
2017-01-19 14:40:31 +03:00
|
|
|
this.get('deleteTheme').perform();
|
2016-08-17 18:01:46 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|