How to disable CKEditor context menu?

前端 未结 12 1428
梦毁少年i
梦毁少年i 2020-12-09 03:34

Does anybody know how to disable CKEditor\'s context (right click) menu? I would expect a configuration option, but I can\'t find one. I am using v3.1. Thanks.

12条回答
  •  再見小時候
    2020-12-09 04:22

    There is still a practical solution, by overriding the prototype function that initializes contextmenu behavior:

    CKEDITOR.dom.element.prototype.disableContextMenu = function () {
        this.on( 'contextmenu', function( event ) {
            // your contextmenu behavior
        });
    };
    

    NOTE: when CKEDITOR loads its JS resources dynamically you need to place it right before the replace call.

提交回复
热议问题