From 3f632f90f690474ff70254ce7415dd4ae92ad3cf Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 29 Jun 2020 16:05:42 +0200 Subject: [PATCH] Fix scroll issue in rich text pads #406 --- www/pad/app-pad.less | 4 ++++ www/pad/csp.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/www/pad/app-pad.less b/www/pad/app-pad.less index e3de1fcf0..bdaf4f5c7 100644 --- a/www/pad/app-pad.less +++ b/www/pad/app-pad.less @@ -1,5 +1,6 @@ @import (reference) "../../customize/src/less2/include/framework.less"; @import (reference) "../../customize/src/less2/include/comments.less"; +@import (reference) "../../customize/src/less2/include/tools.less"; body.cp-app-pad { .framework_main( @@ -39,6 +40,9 @@ body.cp-app-pad { .cke_button__print { display: none !important; } + .cke_button { + .tools_unselectable(); + } } .cke_wysiwyg_frame { width: 100%; diff --git a/www/pad/csp.js b/www/pad/csp.js index 58adab51c..f5fd865c6 100644 --- a/www/pad/csp.js +++ b/www/pad/csp.js @@ -10,6 +10,8 @@ define(['jquery'], function ($) { CKEDITOR.tools.callFunction(Number(m[1]), e.currentTarget); }); + var $iframe = $('iframe').contents().find('html'); + // Buttons var $a = $('.cke_toolbox_main').find('.cke_button, .cke_combo_button'); $a.each(function (i, el) { @@ -24,7 +26,9 @@ define(['jquery'], function ($) { if (!m) { return; } var f = m[1]; var arg = m[2] === "this" ? el : e.originalEvent; + var s = $iframe.scrollTop(); CKEDITOR.tools.callFunction(Number(f), arg); + $iframe.scrollTop(s); }); });