Fix ordinal column with multiple lists
authorJason Etheridge <jason@esilibrary.com>
Thu, 22 Mar 2012 05:54:20 +0000 (01:54 -0400)
committerThomas Berezansky <tsbere@mvlc.org>
Wed, 28 Mar 2012 19:32:33 +0000 (15:32 -0400)
Before this fix, if more than one util.list powered list existed within a given
document/window, they would each intefere with the other's ordinal column.

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Open-ILS/xul/staff_client/chrome/content/util/list.js

index 6dcc359..ef4c96f 100644 (file)
@@ -803,7 +803,7 @@ util.list.prototype = {
         try {
             setTimeout( // Otherwise we can miss a row just added
                 function() {
-                    var nl = document.getElementsByAttribute('label','_');
+                    var nl = obj.node.getElementsByAttribute('label','_');
                     for (var i = 0; i < nl.length; i++) {
                         nl[i].setAttribute(
                             'ord_col',
@@ -814,7 +814,7 @@ util.list.prototype = {
                             'ordinal'
                         );
                     }
-                    nl = document.getElementsByAttribute('ord_col','true');
+                    nl = obj.node.getElementsByAttribute('ord_col','true');
                     for (var i = 0; i < nl.length; i++) {
                         nl[i].setAttribute(
                             'label',