I use ckeditor v4.3.4. I need to add some fields in images dialog. It turned out that when the dialog, the event fires twice dialogDefinition
CKEDITOR.on ('dialogDefinition', function (ev) { var dialogName = ev.data.name, IMAGE = 1 LINK = 2 PREVIEW = 4, CLEANUP = 8; alert (dialogName); });
When I press the call button on any dialogue, I see alert twice. Why is this happening and how can I get rid of it then that event is triggered only once?
Slow to respond but I was
Slow to respond but I was having the same issue.
Did you by chance define your CKEDITOR.on("dialogDefinition") within your config.js, and in that file, within CKEDITOR.editorConfig function definition? And by chance, did you have more than one Editor on the page you were testing?
That's what I had - two editors on page, with the dialogDefinition event function defined within the editorConfig function. This meant that when each editor configured itself the listener got defined (twice total). I realized this when I added a third editor and got three listeners.
Hope this helps someone some day.