From: Jason Etheridge Date: Wed, 30 Jan 2013 22:10:46 +0000 (-0500) Subject: simpler exec.chain implementation X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=2f323c149ee4536d01de6385d50e436f97dca50c;p=working%2FEvergreen.git simpler exec.chain implementation Signed-off-by: Jason Etheridge --- diff --git a/Open-ILS/xul/staff_client/chrome/content/util/exec.js b/Open-ILS/xul/staff_client/chrome/content/util/exec.js index 18e7d1ec0d..5de21ead5c 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/exec.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/exec.js @@ -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 () { diff --git a/Open-ILS/xul/staff_client/server/patron/search_result.js b/Open-ILS/xul/staff_client/server/patron/search_result.js index 49c452228e..ece2ee79d2 100644 --- a/Open-ILS/xul/staff_client/server/patron/search_result.js +++ b/Open-ILS/xul/staff_client/server/patron/search_result.js @@ -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);