mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 20:03:12 +03:00
Removed unused modal-custom-view-form.js file
no issue - the `custom-view-form` modal has been migrated to the newer modal style but the original modal's component file wasn't cleaned up
This commit is contained in:
parent
1b4126b6f0
commit
0be1f206a5
@ -1,58 +0,0 @@
|
||||
import ModalComponent from 'ghost-admin/components/modal-base';
|
||||
import classic from 'ember-classic-decorator';
|
||||
import {action} from '@ember/object';
|
||||
import {resetQueryParams} from 'ghost-admin/helpers/reset-query-params';
|
||||
import {inject as service} from '@ember/service';
|
||||
import {task, timeout} from 'ember-concurrency';
|
||||
|
||||
@classic
|
||||
export default class ModalCustomViewForm extends ModalComponent {
|
||||
@service customViews;
|
||||
@service router;
|
||||
|
||||
delayedModelColor = '';
|
||||
|
||||
init() {
|
||||
super.init(...arguments);
|
||||
this.set('model', this.customViews.editView());
|
||||
this._setDelayedModelColor.perform();
|
||||
}
|
||||
|
||||
@action
|
||||
changeColor(event) {
|
||||
let color = event.target.value;
|
||||
this.set('model.color', color);
|
||||
this.set('delayedModelColor', color);
|
||||
}
|
||||
|
||||
@action
|
||||
confirm() {
|
||||
return this.saveTask.perform();
|
||||
}
|
||||
|
||||
@task(function* () {
|
||||
let view = yield this.customViews.saveViewTask.perform(this.model);
|
||||
this.send('closeModal');
|
||||
return view;
|
||||
})
|
||||
saveTask;
|
||||
|
||||
@task(function* () {
|
||||
let view = yield this.customViews.deleteViewTask.perform(this.model);
|
||||
let routeName = this.router.currentRouteName;
|
||||
this.send('closeModal');
|
||||
this.router.transitionTo(routeName, {queryParams: resetQueryParams(routeName)});
|
||||
return view;
|
||||
})
|
||||
deleteTask;
|
||||
|
||||
// this is a hack to get around radio buttons not working with liquid-fire.
|
||||
// The DOM is duplicated whilst animating-in so browsers end up setting the
|
||||
// checked property on the temporary DOM. Delaying the value being set
|
||||
// allows us to ensure we're updating the checked property after animation
|
||||
@task(function* () {
|
||||
yield timeout(200);
|
||||
this.set('delayedModelColor', this.model.color);
|
||||
})
|
||||
_setDelayedModelColor;
|
||||
}
|
Loading…
Reference in New Issue
Block a user