I'm attempting to override the default hyperlink double click functionality, but I'm having a problem. I can get my own code executed, but the default CKEditor hyperlink edit window still gets displayed afterward. I'm not sure why this happens, or how to prevent it. The code I'm using is below. Any ideas?
editor.on('doubleclick', function(evt) { var element = evt.data.element; // If the selected element is a hyperlink if (element.is('a')) { // custom code goes here } });
Re: Hyperlink doubleclick
If you are not setting evt.data.dialog, it might be getting set by the link listener (which still exists). So you have a few options you might try.
1) Remove the link listener (not sure how to do this)
2) Make sure you're code runs after the link one and set the evt.data.dialog = null. You can probably do this by altering that area where i put XXXXX. I know this works for adding datafilters, so I'm gonna wing it and say it does for this too. The numbers are 1-10.
Re: Hyperlink doubleclick
Re: Hyperlink doubleclick
Re: Hyperlink doubleclick
For example I override the img doubleclick handler which has a priority of 10. I set my priority to be 100 so that I overwrite the dialog setting after the img plugin has already done so.
If you set the priority to 1 you set the dialog property and then the image handler overwrites it.