#12255 closed Bug (fixed)
Anchor dialog does not display existing anchor name when dialog was opened by doubleclick
Reported by: | Henning | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 3.6.6 |
Keywords: | Cc: |
Description
- In CKEditor 4.3.5 and Chrome
- edit a new text
- enter the following in source mode
-
<a id="anchorId" name="anchorName">anchorText</a>
- switch to wysiwyg mode
- doubleclick on anchorText
- in the anchor dialog, the anchor name is not displayed.
If you just click into the text "anchorText" and open the anchor dialog via the toolbar, the anchor name is displayed in the dialog.
Debugging the code in link plugin's anchor.js, I found that the method tryRestoreFakeAnchor did not detect a fake anchor, but was trusted nevertheless such that the existing real anchor was not used. Only if the element was "fullySelected". The following code change resolved the issue:
Existing code:
if ( CKEDITOR.plugins.otmslink.fakeAnchor ) { var realElement = CKEDITOR.plugins.otmslink.tryRestoreFakeAnchor( editor, fullySelected ); realElement && loadElements.call( this, realElement ); this._.selectedElement = fullySelected; } else if ( fullySelected.is( 'a' ) && fullySelected.hasAttribute( 'name' ) )
Changed code
var realElement; if ( CKEDITOR.plugins.otmslink.fakeAnchor ) { realElement = CKEDITOR.plugins.otmslink.tryRestoreFakeAnchor( editor, fullySelected ); realElement && loadElements.call( this, realElement ); this._.selectedElement = fullySelected; } if (!realElement && fullySelected.is('a') && fullySelected.hasAttribute('name')) { loadElements.call(this, fullySelected); }
Change History (3)
comment:1 Changed 11 years ago by
Keywords: | HasPatch added; anchor removed |
---|---|
Status: | new → confirmed |
Version: | 4.3.5 → 3.6.6 |
comment:2 Changed 11 years ago by
Keywords: | HasPatch removed |
---|---|
Resolution: | → fixed |
Status: | confirmed → closed |
comment:3 Changed 11 years ago by
We changed a lot in 4.4 for anchors, so it's very likely that we fixed this.
I'm unable to reproduce this problem in latest CKEditor 4.4.3. In fact I'm not able to reproduce it starting from version 4.4.
This issue seems to be fixed.