Opened 7 years ago

Closed 7 years ago

#1488 closed defect (fixed)

IE(8?) Control Selection lost when Linker (other?) dialog opens - linking images broken

Reported by: gogo Owned by: gogo
Priority: normal Milestone: 0.96
Component: Xinha Core Version: trunk
Severity: normal Keywords:
Cc: ray

Description

Utilising IE8.

  1. Place an Image in the Xinha area.
  2. Click image.
  3. Open linker plugin dialog.
  4. Put in a link url.
  5. Click OK.
  6. Exception thrown.
  • Xinha.prototype.selectNodeContents (in InternetExplorer? module) "node" is being passed in as null
  • this comes from linker.editor.selectNodeContents(a), a is null
  • it is assumed then, that linker.editor._doc.execCommand('createlink') did nothing.

If we look at the display when we click the linker button, the resize handles on the image seem to disappear, suggesting that the selection is lost? Certainly the selection is lost on returning, even when the dialog is simply canceled without change.

A normal selection (click, drag, highlight) works fine and is preserved.

Ray are you familiar with selection issues in IE8, I have a feeling you did some work on that early in the year?

Change History (3)

comment:1 Changed 7 years ago by guest

I may have a solution modules/InterntExplorer/InternetExplorer.js Xinha.prototype.restoreSelection

Instead of ignoring control selections (!savedSelection.parentElement), get the parentElement from item(0) instead.

Replace

  if (!savedSelection.parentElement) 
  {
    return;
  }

with

  var savedParentElement = null;
  if (savedSelection.parentElement)
  {
    savedParentElement =  savedSelection.parentElement();
  }
  else
  {
    savedParentElement = savedSelection.item(0);
  }

After

  var range = this.createRange(this.getSelection());

add

  var rangeParentElement =  null;
  if (range.parentElement)
  {
    rangeParentElement =  range.parentElement();
  }
  else
  {
    rangeParentElement = range.item(0);
  }

Replace

  if (findDoc(savedSelection.parentElement()) == findDoc(range.parentElement()))

with

  if (savedSelection.parentElement && findDoc(savedParentElement) == findDoc(rangeParentElement))

After

  range = this.createRange(this.getSelection());

add

  if (range.parentElement)
  {
    rangeParentElement =  range.parentElement();
  }
  else
  {
    rangeParentElement = range.item(0);
  }

Replace

  if (range.parentElement() != savedSelection.parentElement())

with

  if (rangeParentElement != savedParentElement)

Replace

  var parentDoc = findDoc(savedSelection.parentElement());

with

  var parentDoc = findDoc(savedParentElement);

With IE8 I can now create a link around a selected image. I have not done extensive testing.

Bill Sutton

comment:2 Changed 7 years ago by wymsy

I have tested the above in IE8 and IE6 and found no problems in either.

comment:3 Changed 7 years ago by gogo

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

Committed in changeset:1233

Note: See TracTickets for help on using tickets.