In IE7 (posibly IE6) Insertion.After of table rows after a table row revereses the order of the rows.
var rows = '<tr><td>row 1</td></tr>';
rows += '<tr><td>row 2</td></tr>';
rows += '<tr><td>row 3</td></tr>';
new Insertion.After('someTableRow', rows.join(''));
In Firefox, the rows will show up in order. In IE7, row 3 will show up first, then row 2, row 1, etc...
view live example here:
howardr.s3.amazonaws.com/proto-test.html
to fix it, i did this:
Insertion.After = Class.create();
Insertion.After.prototype = Object.extend(new Abstract.Insertion('afterEnd'), {
initializeRange: function() {
this.range.setStartAfter(this.element);
},
insertContent: function(fragments) {
debugger;
fragments.each((function(fragment) {
this.element.parentNode.insertBefore(fragment,
null); // by making this line 'null' it will always enter the node as the last child
}).bind(this));
}
});