Reputation: 257
I need every click on ckeditor inline toolbar buttons to fire a function and i use this to do just that:
document.getElementById("cke_FormLinePreview").addEventListener("click", setFormLineElementValue);
("cke_FormLinePreview" is the id of the element being edited)
The problem is when i press the options on the different dropdown lists (For example "16" on the font-size dropdown list) it doesn't fire my function. is there any simple way to do that? or do i have to addeventlitsner to every child element of the toolbar to accomplish this task?
Thanks,
Ben
Upvotes: 0
Views: 513
Reputation: 682
every button in ckeditor toolbox calls a function like
return CKEDITOR.tools.callFunction(3,event);
you can override this function below your CHEDITOR initilization code
var OriginalFunction = CKEDITOR.tools.callFunction;
CKEDITOR.tools.callFunction=function(n,x)
{
alert("Called From New function");
//put your code here for event Listener
OriginalFunction(n, x);
}
this will work for me, you can simply put alert to check functionality.
Upvotes: 1