Ghost/ghost/admin/app/components/gh-site-iframe.js
Kevin Ansfield 2b41499b22 Added design customisation and preview to launch wizard
refs https://github.com/TryGhost/Team/issues/450

- moved next/finish buttons into wizard step components in case they need to save before triggering transition
- added icon, logo, and cover image upload+removal to "customise design" step alongside a preview that reloads each time an image is changed
2021-01-18 17:48:11 +00:00

27 lines
839 B
JavaScript

import Component from '@ember/component';
import {computed} from '@ember/object';
import {inject as service} from '@ember/service';
export default Component.extend({
config: service(),
tagName: '',
srcUrl: computed('src', function () {
return this.src || `${this.config.get('blogUrl')}/`;
}),
didReceiveAttrs() {
// reset the src attribute each time the guid changes - allows for
// a click on the navigation item to reset back to the homepage
if ((this.guid !== this._lastGuid) || (this.src !== this._lastSrc)) {
let iframe = document.querySelector('#site-frame');
if (iframe) {
iframe.src = this.src || `${this.config.get('blogUrl')}/`;
}
}
this._lastGuid = this.guid;
this._lastSrc = this.src;
}
});