I am trying to add a event handler to all dialogs onShow to get their height/width.
The problem is that when I say objDialogDefinition.onShow = function(){...} It appears I overwrite the function onShow from the dialog... What happens for example, I insert an image and all is well.. I right-click the image and choose properties, none of image dialog fields gets populated..
How can I add my handler alongside the one for the dialog?
The code is in my editor.htm script tag:
The problem is that when I say objDialogDefinition.onShow = function(){...} It appears I overwrite the function onShow from the dialog... What happens for example, I insert an image and all is well.. I right-click the image and choose properties, none of image dialog fields gets populated..
How can I add my handler alongside the one for the dialog?
The code is in my editor.htm script tag:
CKEDITOR.on('dialogDefinition', function (e) { var dialogName = e.data.name; var dialogDefinition = e.data.definition; dialogDefinition.onShow = function () { var h = this.getSize().height; var w = this.getSize().width; }; dialogDefinition.onHide = function () { alert('dialog closed'); } });
Re: dialogDefinition.onShow adding event handler
Here is how to get the dialog show/hide events