simpler exec.chain implementation collab/phasefx/lp1086458_cleanup_only
authorJason Etheridge <jason@esilibrary.com>
Wed, 30 Jan 2013 22:10:46 +0000 (17:10 -0500)
committerJason Etheridge <jason@esilibrary.com>
Wed, 30 Jan 2013 22:10:46 +0000 (17:10 -0500)
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Open-ILS/xul/staff_client/chrome/content/util/exec.js
Open-ILS/xul/staff_client/server/patron/search_result.js

index 18e7d1e..5de21ea 100644 (file)
@@ -44,6 +44,22 @@ util.exec.prototype = {
             window.removeEventListener('unload',obj.clear_timer,false);
         }
     },
+    // a simpler version of chain, but doesn't have all the same features
+    'chain2' : function(args) {
+        var obj = this;
+        obj.timer(
+            args.concat(
+                function() {
+                    try {
+                        obj.clear_timer();
+                    } catch(E) {
+                        alert('error in chain2: ' + E);
+                    }
+                }
+            ),
+            0
+        );
+    },
     // This executes a series of functions, but tries to give other events/functions a chance to
     // execute between each one.
     'chain' : function () {
index 49c4522..ece2ee7 100644 (file)
@@ -296,7 +296,7 @@ patron.search_result.prototype = {
                 funcs.push( gen_func(results[i]) );
             }
             JSAN.use('util.exec'); var exec = new util.exec(4);
-            exec.chain( funcs );
+            exec.chain2( funcs );
 
         } catch(E) {
             this.error.standard_unexpected_error_alert('patron.search_result.search',E);