问题
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