我在Bootstrap模态框中打开了Ckeditor,但是“格式”和“大小”下拉框不能正常工作。当我点击“大小”或“格式”下拉框时,它们会立即打开并关闭,我看到这是Ckeditor与Bootstrap模态框的一个bug。我在网上找到了解决方法,但它并未起作用。
我在网上找到的解决方案但不起作用:-
$.fn.modal.Constructor.prototype.enforceFocus = function() {
modal_this = this
$(document).on('focusin.modal', function(e) {
if (modal_this.$element[0] !== e.target && !modal_this.$element.has(e.target).length &&
!$(e.target.parentNode).hasClass('cke_dialog_ui_input_select') &&
!$(e.target.parentNode).hasClass('cke_dialog_ui_input_text')) {
modal_this.$element.focus()
}
})
};
我从哪里调用jsp和CK编辑器的JS:
$scope.emailMsgSetting = function(msgId, headerName) {
$ocLazyLoad.load({
name: 'emailSettingsModule',
files: ['/doc/jsp/portal/viewMessageSettings.js']
}).then(function() {
var url = makeURL("/doc/jsp/portal/viewMessageSettings.jsp?");
$scope.dataURL = url;
}, function(e) {
console.log(e);
});
}
我在JSP中实现了ck编辑器
<div class="col-sm-11 nopadright" ng-if="showckeditor">
<textarea ng-model="$parent.msgTypeBody" ck-editor insert-tag="strTagName" height="ckEditorheight" extra-plugins= "strTagName"></textarea>
</div>
谢谢。