]> wagnertech.de Git - kivitendo-erp.git/commitdiff
CKEditor Scrolling Bug in inline_resize plugin (das Dreieck rechts unten)
authorSven Schöling <sven.schoeling@opendynamic.de>
Wed, 10 Jun 2020 09:17:24 +0000 (11:17 +0200)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Wed, 16 Feb 2022 11:43:12 +0000 (12:43 +0100)
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

index 3ffb435bc77e9fe2c542f790dd92cfd641f64721..c4481f679468513169a0c2e4fe36760f0f369f3d 100644 (file)
     }
   });
 
+  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;
       layout( evt );
     } );
 
+    parent.forEach(function(e){
+      e.on('scroll', function (evt) { layout(evt) });
+    });
+
     editor.on( 'blur', function() {
       float_space.hide();
     } );