CKEDITOR:以编程方式关闭查找对话框
CKEDITOR : Programatically close Find Dialog Box
我正在 CKEditor.In 这个插件中创建一个新插件,我想要 Find 插件的一些功能。
因此,我尝试使用以下命令触发它。
editor.execCommand('find');
正在尝试使用以下命令关闭它。
if(editor.execCommand('find')){
$('.cke_dialog_ui_button').click();
//It will close the dialogBox.
}
但我知道这不是正确的方法。
我想在右侧自动关闭它way.How我可以这样做吗?
有人帮我做这个吗?
请尝试以下代码:
var editor = CKEDITOR.replace( 'editor1', {});
editor.on( 'instanceReady', function( evt ) {
editor.on( 'dialogShow', function( evt ) {
evt.data.definition.dialog.hide();
});
editor.execCommand('find');
});
请看:https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_dialog.html#method-hide
我正在 CKEditor.In 这个插件中创建一个新插件,我想要 Find 插件的一些功能。
因此,我尝试使用以下命令触发它。
editor.execCommand('find');
正在尝试使用以下命令关闭它。
if(editor.execCommand('find')){
$('.cke_dialog_ui_button').click();
//It will close the dialogBox.
}
但我知道这不是正确的方法。
我想在右侧自动关闭它way.How我可以这样做吗?
有人帮我做这个吗?
请尝试以下代码:
var editor = CKEDITOR.replace( 'editor1', {});
editor.on( 'instanceReady', function( evt ) {
editor.on( 'dialogShow', function( evt ) {
evt.data.definition.dialog.hide();
});
editor.execCommand('find');
});
请看:https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_dialog.html#method-hide