Hi All!
I want to modify the handler of some elements in content area.
For example: When I make double click on a link automatic open link dialos. So, I want to add a handler for a double click on my own elements to open my own plugin dialog.
Hope help me.
Thanks in advance
Regards Juan Pablo
PD: Sorry for my english.
I want to modify the handler of some elements in content area.
For example: When I make double click on a link automatic open link dialos. So, I want to add a handler for a double click on my own elements to open my own plugin dialog.
Hope help me.
Thanks in advance
Regards Juan Pablo
PD: Sorry for my english.

Re: Double click handler on contet area
Here's how it's used in the link plugin:
editor.on( 'doubleclick', function( evt ) { var element = CKEDITOR.plugins.link.getSelectedLink( editor ) || evt.data.element; if ( !element.isReadOnly() ) { if ( element.is( 'a' ) ) { evt.data.dialog = ( element.getAttribute( 'name' ) && ( !element.getAttribute( 'href' ) || !element.getChildCount() ) ) ? 'anchor' : 'link'; editor.getSelection().selectElement( element ); } else if ( CKEDITOR.plugins.link.tryRestoreFakeAnchor( editor, element ) ) evt.data.dialog = 'anchor'; } });Re: Double click handler on contet area
Tanks for your answer.
I used it but the dialog windows does not open. Why?
Here is my code:
editor.on( 'doubleclick', function( evt ) { var selection = editor.getSelection(); var element = selection.getStartElement(); if (element.is('cmslabel')) element = element.getParent(); if ( !element.isReadOnly() ) { if ( element.is( 'cms_multilinks' ) ) evt.data.type = 'multilinks'; else if ( element.is( 'a' ) && element.getAttribute('taxonomy_id') > 0 ) //0 = Element.nullID evt.data.type = 'taxonomy'; else if ( element.is( 'a' ) && element.getAttribute('element_link_id') > 0 ) //0 = Element.nullID evt.data.type = 'refs'; else if ( element.is( 'a' ) && element.getAttribute('popup_id') > 0 ) //0 = Element.nullID evt.data.type = 'popup'; } });I think that I'm missing some dialogCommand. Is this true?
Re: Double click handler on contet area
And of course, use a debugger to check that the code is executed and has the values that you expect.