How to add buttons on ckeditor widgets that have some functionality built in? -


i have modified simplebox widget given in this widget tutorial include these 3 buttons on hover.

ckeditor widget buttons

i want enable functionality in these buttons, i.e. run javascript on click event. e.g. delete button widget instance gets destroyed (looking through doc found destroy method widget). how should go attaching method on button's click event.

also wanted know, how stop event bubbling (event.stoppropagation) in ckeditor stop further events happening on click event.

any advice helpful. have been struggling long.

and yes, editor rocks. :)

i did inserting following code in editor.widgets.add( 'simplebox', { init property.

that = this; buttons = this.element.getelementsbytag("button");  //getitem(2) points third button element delete buttons.getitem(2).on("click", function() {     //destroys dom of widget     that.wrapper.remove();     //destroys widget memory     ckeditor.instances.editor1.widgets.destroy(that, true); }); 

wrapper.remove() removes dom elements of widget , next line destroys widget implementation.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -