mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
Fixed error when resizing browser after pasting embed link
closes https://github.com/TryGhost/Team/issues/749 - resize event listener is created twice when converting a link to an embed card, if we don't clear the older resize event handler before creating a new one then it persists after the component is torn down and the iframe no longer exists
This commit is contained in:
parent
9bc799258d
commit
b3b5ac6cef
@ -329,6 +329,7 @@ export default Component.extend({
|
||||
},
|
||||
|
||||
_setupWindowResizeHandler(iframe) {
|
||||
window.removeEventListener('resize', this._windowResizeHandler);
|
||||
this._windowResizeHandler = run.bind(this, this._resizeIframe, iframe);
|
||||
window.addEventListener('resize', this._windowResizeHandler, {passive: true});
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user