Yes, the almighty setTimeout can fix anything. Code doesn't work? Let it run later.
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 26 Jul 2005 12:16:13 +0000 (12:16 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 26 Jul 2005 12:16:13 +0000 (12:16 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1471 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/staff_client/chrome/content/evergreen/cat/browse_list.js

index b61485c..3231f5a 100644 (file)
@@ -20,22 +20,26 @@ function my_init() {
 
 function refresh_browse_list() {
        mw.sdump('D_CAT','=-=-=-=-=-=-=-=-=\n\n\nrefresh_browse_list()\n');
-       // Prune tree
-       var nl = document.getElementsByTagName('treeitem');
-       for (var i = 0; i < nl.length; i++) {
-               var v_treeitem = nl[i];
-               if (v_treeitem.getAttribute('object_type') == 'volume') {
-                       var org_treechildren = v_treeitem.parentNode;
-                       var org_treeitem = org_treechildren.parentNode;
-                       org_treeitem.removeChild(org_treechildren);
-                       var org_treerow = org_treeitem.firstChild;
-                       org_treerow.childNodes[1].setAttribute('label','0');
-                       org_treerow.childNodes[2].setAttribute('label','0');
-               }
-       }
-       document.getElementById('browse_meter').value = 0;
-       document.getElementById('browse_meter').setAttribute('real', '0.0');
-       gather_copies();
+       setTimeout(
+               function() {
+                       // Prune tree
+                       var nl = document.getElementsByTagName('treeitem');
+                       for (var i = 0; i < nl.length; i++) {
+                               var v_treeitem = nl[i];
+                               if (v_treeitem.getAttribute('object_type') == 'volume') {
+                                       var org_treechildren = v_treeitem.parentNode;
+                                       var org_treeitem = org_treechildren.parentNode;
+                                       org_treeitem.removeChild(org_treechildren);
+                                       var org_treerow = org_treeitem.firstChild;
+                                       org_treerow.childNodes[1].setAttribute('label','0');
+                                       org_treerow.childNodes[2].setAttribute('label','0');
+                               }
+                       }
+                       document.getElementById('browse_meter').value = 0;
+                       document.getElementById('browse_meter').setAttribute('real', '0.0');
+                       gather_copies();
+               }, 0
+       );
 }
 
 function button_toggle_my_libraries(ev) {