如何在CKEditor 4中禁用编辑模式?(内联编辑器)
我需要在内联模式下禁用编辑模式 我尝试使用这个代码如何在CKEditor 4中禁用编辑模式?(内联编辑器),ckeditor,ckeditor4.x,Ckeditor,Ckeditor4.x,我需要在内联模式下禁用编辑模式 我尝试使用这个代码 CKEDITOR.disableAutoInline = false; var editor = CKEDITOR.inline(elm[0], { extraAllowedContent: '*', toolbarStartupExpanded : false, toolbarCanColla
CKEDITOR.disableAutoInline = false;
var editor = CKEDITOR.inline(elm[0], {
extraAllowedContent: '*',
toolbarStartupExpanded : false,
toolbarCanCollapse : false,
startupFocus: false,
});
editor.on('instanceReady', function (ev) {
var ed = ev.editor;
ed.setReadOnly(true);
editor.removeListener();
});
editor.on('focus', function (event) {
return false;
});
editor.on('blur', function () {
return false;
});
此代码隐藏工具栏,但菜单(鼠标右键单击)是启用的,我需要完全禁用(只读模式)仅用于“渲染内容”,但我需要所有插件,包括“代码”和引号。(如果我使用带有“removePlugin”工具栏的render,我的插件代码、引用等无法正确呈现我的代码)有什么想法吗?只需添加:
config.readOnly = true;
参考:只需添加:
config.readOnly = true;
参考: