Ticket #377 (closed defect: fixed)

Opened 8 years ago

Last modified 4 years ago

Can't insert column after last column in IE

Reported by: anonymous Owned by: gogo
Priority: normal Milestone: 0.96
Component: Plugin_TableOperations Version: trunk
Severity: normal Keywords:
Cc:

Description

Just contributing a suggested patch here. If you try to insert a new column after the last column in a table, IE returns an error. The solution is to omit the 'ref' parameter when the current cell is the last one in the row:

            case "TO-col-insert-before":
	    case "TO-col-insert-after":
		var td = this.getClosest("td");
		if (!td) {
			break;
		}
		var rows = td.parentNode.parentNode.rows;
		var index = td.cellIndex;
                // added line:
                var lastColumn = (td.parentNode.cells.length == index + 1);
		for (var i = rows.length; --i >= 0;) {
			var tr = rows[i];
			var otd = editor._doc.createElement("td");
			otd.innerHTML = mozbr;
			//added block:
                        if (lastColumn && HTMLArea.is_ie) {
				tr.insertBefore(otd);
			} else {
				var ref = tr.cells[index + (/after/.test(button_id) ? 1 : 0)];
				tr.insertBefore(otd, ref);
			}
		}

Note that the line 'var ref = ' was moved

Change History

Changed 8 years ago by gogo

Changed 8 years ago by gogo

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

Changed 6 years ago by guest

  • status changed from closed to reopened
  • version set to trunk
  • resolution deleted

i tried to insert a column before the last column in IE 7 (don't know about IE 6), and it's not working, it inserts after. when with Firefox it works great.

working with today's download of Xinha_0.931.zip

Changed 6 years ago by wymsy

It works correctly for me in IE 6. I don't have IE 7 so can't test that.

Changed 5 years ago by ray

  • milestone set to 0.96

I can confirm it inserts the column after in IE6 & 7

Changed 4 years ago by gogo

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

So I think that means it's fixed.

Note: See TracTickets for help on using tickets.