From: Tom Clegg Date: Mon, 19 Jan 2015 23:54:38 +0000 (-0500) Subject: 4831: Remove old reference to util namespace. X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/3b62145615a5b40be68b44ffbfda1e3ddb5a6699 4831: Remove old reference to util namespace. --- diff --git a/apps/backstage/app/util.js b/apps/backstage/app/util.js index 277124fd9e..a856da2fa0 100644 --- a/apps/backstage/app/util.js +++ b/apps/backstage/app/util.js @@ -3,8 +3,8 @@ module.exports = { debounce: debounce, }; -// util.choose('a', {a: 'A', b: 'B'}) --> return 'A' -// util.choose('a', {a: [console.log, 'foo']}) --> return console.log('foo') +// choose('a', {a: 'A', b: 'B'}) --> return 'A' +// choose('a', {a: [console.log, 'foo']}) --> return console.log('foo') function choose(key, options) { var option = options[key]; if (option instanceof Array && option[0] instanceof Function) @@ -13,13 +13,13 @@ function choose(key, options) { return option; } -// util.debounce(250, key) --> Return a promise. If someone else +// debounce(250, key) --> Return a promise. If someone else // calls debounce with the same key, reject the promise. If nobody // else has done so after 250ms, resolve the promise. function debounce(ms, key) { var newpending; - util.debounce.pending = util.debounce.pending || []; - util.debounce.pending.map(function(found) { + debounce.pending = debounce.pending || []; + debounce.pending.map(function(found) { if (!newpending && found.key === key) { // Promise already pending with this key. Reject the old // one, reuse its slot for the new one. @@ -32,15 +32,15 @@ function debounce(ms, key) { if (!newpending) { // No pending promise with this key. newpending = {key: key} - util.debounce.pending.push(newpending); + debounce.pending.push(newpending); } newpending.deferred = m.deferred(); m.startComputation(); newpending.timer = window.setTimeout(function() { // Success, no more bouncing. Remove from pending list. - util.debounce.pending.map(function(found, i) { + debounce.pending.map(function(found, i) { if (found === newpending) { - util.debounce.pending.splice(i, 1); + debounce.pending.splice(i, 1); found.deferred.resolve(); m.endComputation(); }