How to Remove ContextMenu in CKEditor 4.3

99封情书 提交于 2020-01-03 20:01:41

问题


I am having a hard time trying to disable the context menu from the editor. For instance when a user clicks on a image I don't want to show that context menu but the browser context.

I tried to add to remove plugins configuration setting "contextmenu" but that did nothing. From the posts I seen here the soultion to get rid of the context menu seems to change every version.


回答1:


Tested in Ckeditor 4.7.1, works for me:

CKEDITOR.editorConfig = function (config) {
  config.language = 'en';
  config.toolbar = "mini";
  config.removePlugins = 'elementspath,contextmenu,liststyle,tabletools,tableselection';
  config.disableNativeSpellChecker = false;
}



回答2:


The solution was always the same:

config.removePlugins = 'contextmenu,tabletools';

And I don't know any situation in which this does not work. See an example.

PS. Disabling CKEditor's context menu isn't recommended.

EDIT: My fault, I haven't checked the console. To remove the contextmenu plugin I first need to remove tabletools which requires the first one. So I updated an example - see http://jsfiddle.net/xay4E/4/. When you can't disable some plugin, because of requirements, an error is logged on the console.



来源:https://stackoverflow.com/questions/25023478/how-to-remove-contextmenu-in-ckeditor-4-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!