mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 05:50:35 +03:00
e7b740ba5f
no issue - return a basic "guid" from the site's `model` hook so that we have some data which changes on each refresh - add an action to the wrapper element of the "view site" link which will cause the route to refresh when clicked if we're already on the route - move the site iframe into a component so that it can watch an @uuid property and force a reset of the iframe's `src` when it detects a change
21 lines
607 B
JavaScript
21 lines
607 B
JavaScript
import Component from '@ember/component';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default Component.extend({
|
|
config: service(),
|
|
|
|
tagName: '',
|
|
|
|
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) {
|
|
let iframe = document.querySelector('#site-frame');
|
|
if (iframe) {
|
|
iframe.src = `${this.config.get('blogUrl')}/`;
|
|
}
|
|
}
|
|
this._lastGuid = this.guid;
|
|
}
|
|
});
|