I want to add a listener of selectPage event to my CKEditor plugin, but so far I'm unable to get it to work. The plugin works fine but my listener is not working. The alert below never gets called.
The code:
Is there something I'm doing wrong?
The code:
var dialog = function(editor) {
editor.on('selectPage', function(e) {
alert("Page changed");
});
// rest of the plugin code
}
Is there something I'm doing wrong?

Re: How to add a selectPage listener?
Re: How to add a selectPage listener?
I've tried it the following ways, but it won't work
var dialog = function(editor) { this.on('selectPage', function(e) { alert("Page changed"); }); // rest of the plugin code }and
CKEDITOR.dialog.add('plugin', function(editor) { var d = dialog(editor); // call to the dialog function d.on('selectPage', function(e) { alert("Page changed"); }); return d; });Re: How to add a selectPage listener?
You can get the real object for example by using an onLoad function:
return { title : editor.lang.googlemaps.title, minWidth : 500, minHeight : 460, onLoad : function() { theDialog = this; // Act on tab switching theDialog.on('selectPage', function (e) { if (CKEDITOR.env.ie7Compat) fixIE7display();The trick there is that when that onLoad is executed, it will be done on the real dialog, so "this" will work.
Re: How to add a selectPage listener?