This is driving me nuts, I have been working on it all morning. I have a simple 'link' plugin that allows custom links to be added. I need to be able to get the selected element, so I can wrap it in an AHREF tag via my link plugin.
The problem is, I when I call click on the image in the editor, the image receives a selection (outline) but when I call editor.getSelection().getSelectedElement() or getStartElement() the result is null.
I AM able to get the element when it is an anchor tag for example, but image elements do not work.
I am testing this, so far, in FireFox 16.02 on windows 7.
Note, firebug shows the following error anytime something is selected in the editor (selection plugin line 1150), but I assume this is okay, since its in a try/catch and has a console.log() statement:
TypeError: self.getNative().createRange is not a function
return self.getNative().createRange().item( 0 );
=================================================
I am pretty desperate for a solution and willing to pay for help. PM me if you want to help me get this working.
=================================================
The problem is, I when I call click on the image in the editor, the image receives a selection (outline) but when I call editor.getSelection().getSelectedElement() or getStartElement() the result is null.
I AM able to get the element when it is an anchor tag for example, but image elements do not work.
I am testing this, so far, in FireFox 16.02 on windows 7.
Note, firebug shows the following error anytime something is selected in the editor (selection plugin line 1150), but I assume this is okay, since its in a try/catch and has a console.log() statement:
TypeError: self.getNative().createRange is not a function
return self.getNative().createRange().item( 0 );
=================================================
I am pretty desperate for a solution and willing to pay for help. PM me if you want to help me get this working.
=================================================