mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-25 09:03:12 +03:00
Fixed design settings preview losing scroll position when changing settings
refs https://github.com/TryGhost/Team/issues/1149 - replicated the visible iframe's `scrollTop` to the hidden iframe before swapping visibility between them so the scroll position remains consistent even though the contents and frames are fully reloaded and swapped
This commit is contained in:
parent
552412d323
commit
977e4d55f4
@ -62,6 +62,7 @@ export default class GhHtmlIframeComponent extends Component {
|
||||
window.clearTimeout(this.swapTimeout);
|
||||
|
||||
if (this.iframes.indexOf(renderedIframe) !== this.renderedIframe) {
|
||||
this.iframes[this.toRenderIframe].contentDocument.body.scrollTop = this.iframes[this.renderedIframe].contentDocument.body.scrollTop;
|
||||
this.iframes[this.toRenderIframe].style = this.visibleIframeStyle;
|
||||
this.renderedIframe = this.toRenderIframe;
|
||||
this.toRenderIframe = this.toRenderIframe === 0 ? 1 : 0;
|
||||
|
Loading…
Reference in New Issue
Block a user