我通過修改froala_editor.js文件得到了我的問題的解決。我所做的是修改了彈出窗口的Show方法定義。
找出下面的評論並更新下面的if/else代碼的if條件。
if (editor.opts.toolbarBottom && $container && editor.$tb && $container.get(0) == editor.$tb.get(0)) {
popups[id].addClass('fr-above');
if (top) top = top - popups[id].outerHeight();
}
else if (top) {
if ((top + popups[id].outerHeight() + 31) > ($(window).height() + window.pageYOffset)) {
popups[id].addClass('fr-above');
popups[id].addClass('manual-above');
top = top - popups[id].outerHeight();
if (obj_height) {
top = top - obj_height;
}
}
}
並在隱藏方法中刪除類。
popups[id].removeClass('manual-above');
並在_topNormalized方法更新下面的代碼。
if (p_offset + top + height > $(editor.o_doc).outerHeight() && $el.parent().offset().top + new_top > 0) {
top = new_top;
$el.addClass('fr-above');
}
else {
if (!$el.hasClass('manual-above')) {
$el.removeClass('fr-above');
}
}
這對我有用。希望這對其他人也有幫助。