From 26ce76e6da692d0d2b0e96fa0138dbb136a62609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Koszuli=C5=84ski?= Date: Tue, 20 Aug 2019 15:30:27 +0200 Subject: [PATCH] Final direction. And made sure it won't get removed during minification. --- src/imageupload/imageuploadediting.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/imageupload/imageuploadediting.js b/src/imageupload/imageuploadediting.js index 38291178..1eed5bbd 100644 --- a/src/imageupload/imageuploadediting.js +++ b/src/imageupload/imageuploadediting.js @@ -204,7 +204,7 @@ export default class ImageUploadEditing extends Plugin { return; } - const domFigure = editor.editing.view.domConverter.mapDomToView( viewImg.parent ); + const domFigure = editor.editing.view.domConverter.mapViewToDom( viewImg.parent ); if ( !domFigure ) { return; @@ -214,7 +214,8 @@ export default class ImageUploadEditing extends Plugin { domFigure.style.display = 'none'; - const offsetHeightBefore = domFigure.offsetHeight; // eslint-disable-line no-unused-vars + // Make sure this line will never be removed during minification for having "no effect". + domFigure._ckHack = domFigure.offsetHeight; domFigure.style.display = originalDisplay; } );