mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 10:53:34 +03:00
e75720d390
- the new preview mode doesn't require settings to be saved in advance - TODO: prevent interaction with the iframe a la portal Notes: - this works by sending a post message to the frontend with a custom header - generated HTML is loaded into the iframe using postMessage - we can possibly write the HTML direct to the iframe - something to experiment with later
47 lines
1.2 KiB
JavaScript
47 lines
1.2 KiB
JavaScript
/* eslint-disable ghost/ember/alias-model-in-controller */
|
|
import Controller from '@ember/controller';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default Controller.extend({
|
|
|
|
settings: service(),
|
|
|
|
queryParams: ['showPortalSettings', 'showBrandingModal'],
|
|
|
|
showPortalSettings: false,
|
|
showBrandingModal: false,
|
|
showLeaveSettingsModal: false,
|
|
|
|
tagName: '',
|
|
|
|
actions: {
|
|
openStripeSettings() {
|
|
this.set('membersStripeOpen', true);
|
|
},
|
|
|
|
closePortalSettings() {
|
|
const changedAttributes = this.settings.changedAttributes();
|
|
if (changedAttributes && Object.keys(changedAttributes).length > 0) {
|
|
this.set('showLeaveSettingsModal', true);
|
|
} else {
|
|
this.set('showPortalSettings', false);
|
|
}
|
|
},
|
|
|
|
closeLeaveSettingsModal() {
|
|
this.set('showLeaveSettingsModal', false);
|
|
},
|
|
|
|
leavePortalSettings() {
|
|
this.settings.rollbackAttributes();
|
|
this.set('showPortalSettings', false);
|
|
this.set('showLeaveSettingsModal', false);
|
|
},
|
|
|
|
closeBrandingModal() {
|
|
this.set('showBrandingModal', false);
|
|
}
|
|
}
|
|
|
|
});
|