Remove the Context Menu in TinyMCE

前端 未结 4 764
猫巷女王i
猫巷女王i 2020-12-20 13:26

TinyMCE has a built-in contextmenu which activates when you right-click in the content editor area. I need to remove this menu due to the copy/cut/paste in the menu. It fo

相关标签:
4条回答
  • 2020-12-20 13:58

    In version 5, context menu is built in the core. This has helped me:

    tinymce.init({
        ...
        contextmenu: false,
        ...
    });
    
    0 讨论(0)
  • 2020-12-20 14:15

    Commenting this line in /plugins/contextmenu/editor_plugin.js worked for me:

    f.addSeparator();f.add({title:"advanced.image_desc",icon:"image",cmd:h.plugins.advimage?"mceAdvImage":"mceImage",ui:true});
    

    If for any reason you use the non-minified js, comment this:

    m.addSeparator();
    m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});
    
    0 讨论(0)
  • 2020-12-20 14:16

    Try to remove the complete script in plugins/contextmenu/editor.plugin.js (It's only 1 line so it's sufficient to put 2 slashes at the start).

    It works for me, the contextmenu no longer appears.

    0 讨论(0)
  • 2020-12-20 14:21

    The easy solution is to remove the contextmenu plugin in your tinymce init:

     plugins : "inlinepopups,insertdatetime,fullscreen,contextmenu",
    

    becomes

     plugins : "inlinepopups,insertdatetime,fullscreen",
    
    0 讨论(0)
提交回复
热议问题