Javascript CKEDITOR:以编程方式关闭“查找”对话框

Javascript CKEDITOR:以编程方式关闭“查找”对话框,javascript,jquery,ckeditor,Javascript,Jquery,Ckeditor,我正在CKEditor中创建一个新插件。在这个插件中,我想要一些查找插件的功能 因此,我尝试使用下面的命令触发它 editor.execCommand('find'); if(editor.execCommand('find')){ $('.cke_dialog_ui_button').click(); //It will close the dialogBox. } 试图用下面的命令关闭它 editor.execCommand('find'); if(editor.execCo

我正在CKEditor中创建一个新插件。在这个插件中,我想要一些查找插件的功能

因此,我尝试使用下面的命令触发它

editor.execCommand('find');
if(editor.execCommand('find')){
   $('.cke_dialog_ui_button').click();
  //It will close the dialogBox.
}
试图用下面的命令关闭它

editor.execCommand('find');
if(editor.execCommand('find')){
   $('.cke_dialog_ui_button').click();
  //It will close the dialogBox.
}
但我知道这不是正确的方法

我想以正确的方式自动关闭它。我该怎么做

任何人,请帮助我执行此操作?

请尝试以下代码:

var editor = CKEDITOR.replace( 'editor1', {});
editor.on( 'instanceReady', function( evt ) {
    editor.on( 'dialogShow', function( evt ) {
        evt.data.definition.dialog.hide();
    });                 
    editor.execCommand('find');
}); 
请参阅: