Fix scroll issue in rich text pads #406

pull/1/head
yflory 5 years ago
parent 26765596e4
commit 3f632f90f6

@ -1,5 +1,6 @@
@import (reference) "../../customize/src/less2/include/framework.less"; @import (reference) "../../customize/src/less2/include/framework.less";
@import (reference) "../../customize/src/less2/include/comments.less"; @import (reference) "../../customize/src/less2/include/comments.less";
@import (reference) "../../customize/src/less2/include/tools.less";
body.cp-app-pad { body.cp-app-pad {
.framework_main( .framework_main(
@ -39,6 +40,9 @@ body.cp-app-pad {
.cke_button__print { .cke_button__print {
display: none !important; display: none !important;
} }
.cke_button {
.tools_unselectable();
}
} }
.cke_wysiwyg_frame { .cke_wysiwyg_frame {
width: 100%; width: 100%;

@ -10,6 +10,8 @@ define(['jquery'], function ($) {
CKEDITOR.tools.callFunction(Number(m[1]), e.currentTarget); CKEDITOR.tools.callFunction(Number(m[1]), e.currentTarget);
}); });
var $iframe = $('iframe').contents().find('html');
// Buttons // Buttons
var $a = $('.cke_toolbox_main').find('.cke_button, .cke_combo_button'); var $a = $('.cke_toolbox_main').find('.cke_button, .cke_combo_button');
$a.each(function (i, el) { $a.each(function (i, el) {
@ -24,7 +26,9 @@ define(['jquery'], function ($) {
if (!m) { return; } if (!m) { return; }
var f = m[1]; var f = m[1];
var arg = m[2] === "this" ? el : e.originalEvent; var arg = m[2] === "this" ? el : e.originalEvent;
var s = $iframe.scrollTop();
CKEDITOR.tools.callFunction(Number(f), arg); CKEDITOR.tools.callFunction(Number(f), arg);
$iframe.scrollTop(s);
}); });
}); });

Loading…
Cancel
Save