Reputation: 42670
Previously, by clicking a toolbar button, I will launch my custom dialog immediately.
editor.addCommand('launch', new CKEDITOR.dialogCommand('myLaunchDialog'));
However, now, I wish to
Here's what I'm trying to do
editor.addCommand('launch', {
exec : function( editor ) {
performNetworkActivity(function() {
// Network activity done!
var command = new CKEDITOR.dialogCommand('myLaunchDialog');
// Hem... doesn't work
editor.execCommand(command);
});
}},
async : false
});
Note, execCommand
doesn't work for me.
var command = new CKEDITOR.dialogCommand('myLaunchDialog');
// Hem... doesn't work
editor.execCommand(command);
I even tried
var command = new CKEDITOR.dialogCommand('myLaunchDialog');
command.enable();
command.exec();
Doesn't work still...
May I know what is the proper way to launch custom dialog programmatic-ally?
My dialog is defined as
CKEDITOR.dialog.add('myLaunchDialog', function( editor ) {
Upvotes: 1
Views: 893
Reputation: 42670
Here's the proper way to fire dialog command.
var command = new CKEDITOR.dialogCommand('myLaunchDialog');
editor.addCommand('_myLaunchDialog', command);
editor.addCommand('launch', {
exec : function( editor ) {
performNetworkActivity(function() {
// Network activity done!
editor.execCommand("_myLaunchDialog");
});
}},
async : false
});
Upvotes: 1