Fix scroll issue in rich text pads #406

pull/1/head
yflory 2020-06-29 16:05:42 +02:00
parent 26765596e4
commit 3f632f90f6
2 changed files with 8 additions and 0 deletions

View File

@ -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%;

View File

@ -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);
});
});