From 00cd5067975cd23c5fa1f659518eb420bd8e759d Mon Sep 17 00:00:00 2001 From: Pablo Zmdl Date: Tue, 14 Jan 2025 19:42:13 +0100 Subject: [PATCH] Fix potential problem with multiple content iframes --- program/js/app.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/program/js/app.js b/program/js/app.js index 409b2a133b9..1be126a843e 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -10681,11 +10681,11 @@ function rcube_webmail() { this.resize_preview_iframe = function (iframe) { // Cancel runs that we're scheduled ealier but didn't run yet. - if (this.resizePreviewIframeTimer) { - clearTimeout(this.resizePreviewIframeTimer); + if (iframe.resizePreviewIframeTimer) { + clearTimeout(iframe.resizePreviewIframeTimer); } // Using setTimeout to put this at the end of the call stack. - this.resizePreviewIframeTimer = setTimeout(() => { + iframe.resizePreviewIframeTimer = setTimeout(() => { // Reset the height to avoid growing it bigger and bigger (due to // our adding of 20 pixels, and 8 extra pixels of unknown origin, // which are always added. @@ -10693,7 +10693,7 @@ function rcube_webmail() { var wantedHeight = iframe.contentDocument.firstChild.scrollHeight; // Add a few pixels to avoid problems with wrapped lines. iframe.style.height = wantedHeight + 20 + 'px'; - this.resizePreviewIframeTimer = null; + iframe.resizePreviewIframeTimer = null; }, 50); }; } // end object rcube_webmail