Search code examples
javascriptjqueryckeditor

CKEDITOR: Prevent image properties dialog from appearing on <img> double click


I'm working with CKEDITOR 4.5.1 and would like to disable the image properties dialog from appearing when an image is double-clicked within the editor.

After searching I came across what looked to be the solution, which is the following:

 CKEDITOR.instances.pageContent.on( 'doubleclick', function( evt ) {
    var element = evt.data.element;
    if ( element.is( 'img' ) && !element.data( 'cke-realelement' ) && !element.isReadOnly() ){
       evt.data.dialog = null;
    }
 }, null, null, 10000) ;//priority has to be higher than image priority.

The code does trigger and does set dialog to null, however, the default image properties dialog still appears. My assumption is the listener within CKEDITOR is running after the above code executes and sets the dialog. I've tried different values in place of 10000 with no success.


Solution

  • this config worked for me

    CKEDITOR.config.removePlugins = 'image,forms';

    I have version 4.5.4