Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Bug Reports & Fixes:
[RC3 BUG] Mozilla - insert link over image fails to add title and target; same for IE and double click



Lukasz
New User

Feb 10, 2005, 2:25 PM


Views: 15706
[RC3 BUG] Mozilla - insert link over image fails to add title and target; same for IE and double click

when you click on image (to select it) then you click on create link. hArea creates link but since getParentElement() returns parent element (i.e. P) instead of element 'A' it fails to add title and target to the ceated link.

Another nice thing is double click on string + insert link - on IE it will fail to add target and title.

Has anyone fixed this?

As a quick fix for IE:
I have replaced call in createLink from getParentElement() to getParentElementForSelection(). Where getParentElementForSelection is exact copy of getParentElement(), the only difference is:

if (HTMLArea.is_ie) {
switch (sel.type) {
case "Text":
case "None":
> range.moveEnd("character", -1);
return range.parentElement();