Ticket #377 (closed defect: fixed)
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
Note: See
TracTickets for help on using
tickets.
