Opened 14 years ago

Closed 13 years ago

#351 closed defect (fixed)

[patch] getSelectedHTML returns 'undefined' if the selection is an image in IE.

Reported by: patrick@… Owned by: gogo
Priority: normal Milestone: Version 1.0
Component: Xinha Core Version: trunk
Severity: normal Keywords:
Cc:

Description

Calling createRange with an image being active (ex: after a click on it) returns a controlRange in IE, not a textRange.
Thus, in line 3156 of htmlarea.js :

existing = range.htmlText

existing becomes undefined.

I've made a dirty hack catching length of the range to detect the existence of a controlRange and return the outerHTML of it's first item :

existing = (range.length == 1) ? range(0).outerHTML : range.htmlText;

There should be a better way to do it :)

Change History (2)

comment:1 Changed 14 years ago by gogo

  • Milestone set to Version 1.0
  • Summary changed from getSelectedHTML returns 'undefined' if the selection is an image in IE. to [patch] getSelectedHTML returns 'undefined' if the selection is an image in IE.
  • Version set to trunk

comment:2 Changed 13 years ago by gogo

  • Resolution set to fixed
  • Status changed from new to closed

Checked in a better fix in changeset:500

Note: See TracTickets for help on using tickets.