🐛 fix DeckEditor iframe resize issue in chrome 61

This commit is contained in:
deardrops 2017-09-28 23:25:19 +08:00 committed by webxoss
parent 956658e3dc
commit a8c37e7d85

View file

@ -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) {