mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 18:31:57 +03:00
3f0dbb0e8b
refs https://github.com/TryGhost/Team/issues/1149 - re-used same desktop/mobile toggle that the main design settings screen uses
47 lines
1.3 KiB
JavaScript
47 lines
1.3 KiB
JavaScript
import Component from '@glimmer/component';
|
|
import {action} from '@ember/object';
|
|
import {inject as service} from '@ember/service';
|
|
import {tracked} from '@glimmer/tracking';
|
|
|
|
export default class ViewThemeModalComponent extends Component {
|
|
@service modals;
|
|
@service router;
|
|
|
|
@tracked previewSize = 'desktop';
|
|
|
|
get isDesktopPreview() {
|
|
return this.previewSize === 'desktop';
|
|
}
|
|
|
|
get isMobilePreview() {
|
|
return this.previewSize === 'mobile';
|
|
}
|
|
|
|
willDestroy() {
|
|
super.willDestroy(...arguments);
|
|
|
|
// leave install modal visiible if it's in the success state because
|
|
// we're switching over to the design customisation screen in the bg
|
|
// and don't want to auto-close when this modal closes
|
|
if (this.installModal && !this.showingSuccessModal) {
|
|
this.installModal.close();
|
|
}
|
|
}
|
|
|
|
@action
|
|
installTheme() {
|
|
this.installModal = this.modals.open('modals/design/install-theme', {
|
|
theme: this.args.data.theme,
|
|
onSuccess: () => {
|
|
this.showingSuccessModal = true;
|
|
this.router.transitionTo('settings.design');
|
|
}
|
|
});
|
|
}
|
|
|
|
@action
|
|
setPreviewSize(size) {
|
|
this.previewSize = size;
|
|
}
|
|
}
|