Ticket #351 (closed defect: fixed)

Opened 8 years ago

Last modified 7 years ago

[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

Changed 8 years ago by gogo

  • 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
  • milestone set to Version 1.0

Changed 7 years ago by gogo

  • status changed from new to closed
  • resolution set to fixed

Checked in a better fix in changeset:500

Note: See TracTickets for help on using tickets.