diff options
Diffstat (limited to 'program/js')
-rw-r--r-- | program/js/list.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/program/js/list.js b/program/js/list.js index 0385092d6..fbebc8a20 100644 --- a/program/js/list.js +++ b/program/js/list.js @@ -217,7 +217,7 @@ remove_row: function(uid, sel_next) /** * Add row to the list and initialize it */ -insert_row: function(row, attop) +insert_row: function(row, before) { var tbody = this.tbody; @@ -240,8 +240,8 @@ insert_row: function(row, attop) row = domrow; } - if (attop && tbody.childNodes.length) - tbody.insertBefore(row, tbody.firstChild); + if (before && tbody.childNodes.length) + tbody.insertBefore(row, (typeof before == 'object' && before.parentNode == tbody) ? before : tbody.firstChild); else tbody.appendChild(row); |