From 0c798e3547dc504051515ee38d23718f665966b4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Wed, 10 Jun 2020 11:17:24 +0200 Subject: [PATCH] CKEditor Scrolling Bug in inline_resize plugin (das Dreieck rechts unten) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Gleicher Bug wie in der floatingspace toolbar, hier aber einfacher zu fixen, weil wir den Code nicht minifien müssen. Ausserdem wir dder layout Call hier nicht durch einen buffer gejadgt, und muss deshalb auch nicht detacht werden. Ansonsten analog zu der Beschreibung da. egw 12629 (cherry picked from commit 9eb2f5e8af80cc62ff070f950c5344f36e1dfba5) (cherry pick von odyn) --- js/ckeditor/plugins/inline_resize/plugin.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/js/ckeditor/plugins/inline_resize/plugin.js b/js/ckeditor/plugins/inline_resize/plugin.js index 3ffb435bc..c4481f679 100644 --- a/js/ckeditor/plugins/inline_resize/plugin.js +++ b/js/ckeditor/plugins/inline_resize/plugin.js @@ -12,8 +12,20 @@ } }); + function parentScroll(e) { + var position = e.$.getAttribute("position"), + excludeStaticParent = position === "absolute"; + return e.getParents().filter( function(parent) { + var style = window.getComputedStyle(parent.$); + if ( excludeStaticParent && style.position === "static" ) + return false; + return (/(auto|scroll)/).test( style['overflow'] + style["overflow-y"] + style["overflow-x"] ); + }); + }; + function attach( editor ) { - var config = editor.config; + var config = editor.config, + parent = parentScroll(editor.element); var resize = function (width, height) { var editable; @@ -100,6 +112,10 @@ layout( evt ); } ); + parent.forEach(function(e){ + e.on('scroll', function (evt) { layout(evt) }); + }); + editor.on( 'blur', function() { float_space.hide(); } ); -- 2.20.1