Hello -
maybe its a dumb question, but how is it possible to add a double-click event to a <span> tag with a certain class within the document of a ckeditor instance? I would like to trigger a custom function for certain elements. Is it possible?
Thanks for any hints
Best wishes
Urs Hofer
maybe its a dumb question, but how is it possible to add a double-click event to a <span> tag with a certain class within the document of a ckeditor instance? I would like to trigger a custom function for certain elements. Is it possible?
Thanks for any hints
Best wishes
Urs Hofer

Re: add event to span with class
ed.editor.on('doubleclick', function(e) { var elem = e.data.element.$; if (elem.getAttribute("class")=="correx") { /* Do something here only for an element with the class correx */ } });But I don't know if there is a more elegant solution than adding an event to the whole editor and filtering out the correct element afterwards.
Best
Hofer
Re: add event to span with class
ed.editor.on('doubleclick', function(e) { var elem = e.data.element; if (elem.hasClass("correx")) { alert("Content of double clicked element: " + elem.getText()); } });I can live with that solution...
best
Hofer