Ghost/ghost/admin/app/routes/settings/labs/import.js
Peter Zimon 3eaa00bddb Restructured modal open logic
no refs.

- Navigating to `/settings/labs/import` opened the modal but also transitioned to a blank page in the background. Restructured content import modal so it's opening on top of the Labs page.
2022-11-17 14:40:24 +00:00

26 lines
755 B
JavaScript

import AdminRoute from 'ghost-admin/routes/admin';
import ImportContentModal from '../../../components/modal-import-content';
import {action} from '@ember/object';
import {inject as service} from '@ember/service';
export default class LabsImportRoute extends AdminRoute {
@service modals;
importModal = null;
setupController(controller, model) {
this.importModal?.close();
this.importModal = this.modals.open(ImportContentModal, {}, {
className: 'fullscreen-modal fullscreen-modal-action fullscreen-modal-import-content',
beforeClose: this.beforeModalClose
});
}
@action
async beforeModalClose() {
this.router.transitionTo('settings.labs');
return true;
}
}