I have a problem with the selection handles of an image in Firefox.
I created a new plugin called "myAnchor" to make it possible to search for a given anchor in the document.
When the myAnchor iframe dialog opens, you see an overview of the anchors defined in the document and you can select an anchor. Once you select an anchor in the dialog, the dialog closes and the anchor is selected and highlighted (selection handles) in the document.
This works fine for most browsers, except for Firefox. In Firefox, the new anchor is not highlighted (although it is selected, I checked that using code, but the selection handles are missing).
Someone has a solution or explanation for this ?
Below the code I use.
I created a new plugin called "myAnchor" to make it possible to search for a given anchor in the document.
When the myAnchor iframe dialog opens, you see an overview of the anchors defined in the document and you can select an anchor. Once you select an anchor in the dialog, the dialog closes and the anchor is selected and highlighted (selection handles) in the document.
This works fine for most browsers, except for Firefox. In Firefox, the new anchor is not highlighted (although it is selected, I checked that using code, but the selection handles are missing).
Someone has a solution or explanation for this ?
Below the code I use.
function gotoAnchor() { var oElements = oEditor.document.getElementsByTag('img'); var oRealAnchors = new editorWindow.CKEDITOR.dom.nodeList(oEditor.document.$.anchors); var aAnchors = new Array(); var bAnchors = new Array(); var counter = 0 for (var i = 0; i < oElements.count(); i++) { var item = oElements.getItem(i); if (item.data('cke-realelement') && item.data('cke-real-element-type') == 'anchor') { aAnchors[counter] = oEditor.restoreRealElement(item); bAnchors[counter] = item; counter += 1; } } for (i = 0; i < oRealAnchors.count(); i++) { aAnchors[counter] = oRealAnchors.getItem(i); bAnchors[counter] = oRealAnchors.getItem(i); counter += 1; } var sName = d.getElementById('anchors').value; //sName is the anchor we are looking for for (i = 0; i < aAnchors.length; i++) { if (aAnchors[i].getAttribute('name') == sName) { oEditor.focus(); oEditor.getSelection().selectElement(bAnchors[i]); bAnchors[i].scrollIntoView(); break; } }