From a8c37e7d850108b6ee0dc2a1229562e7570d5f93 Mon Sep 17 00:00:00 2001 From: deardrops Date: Thu, 28 Sep 2017 23:25:19 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20DeckEditor=20iframe=20resi?= =?UTF-8?q?ze=20issue=20in=20chrome=2061?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- testHelper.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/testHelper.js b/testHelper.js index eb6dee1..e16bcd8 100644 --- a/testHelper.js +++ b/testHelper.js @@ -293,13 +293,12 @@ function changeLanguage() { function handleDeckEditor() { var iFrame = $('deck-editor'); - //resizeIFrameToFitContent - iFrame.width = iFrame.contentWindow.document.body.scrollWidth; - iFrame.height = iFrame.contentWindow.document.body.scrollHeight; + // resize iframe to fit content + iFrame.width = iFrame.contentWindow.document.body.scrollWidth || iFrame.contentDocument.documentElement.scrollWidth; + iFrame.height = iFrame.contentWindow.document.body.scrollHeight || iFrame.contentDocument.documentElement.scrollHeight; // disable deck-editor return - iFrame.contentDocument - .getElementById('link-back-to-webxoss').href = "#" + iFrame.contentDocument.getElementById('link-back-to-webxoss').href = "#" // auto update deck names when change in deckEditor window.addEventListener('storage', function(e) {