Merge branch 'MDL-32509' of git://github.com/danpoltawski/moodle
[moodle.git] / lib / yui / 3.5.0 / build / parallel / parallel-min.js
blob0e690a952afd81ddb3b3d10ed253b40106d9232e
1 /*
2 YUI 3.5.0 (build 5089)
3 Copyright 2012 Yahoo! Inc. All rights reserved.
4 Licensed under the BSD License.
5 http://yuilibrary.com/license/
6 */
7 YUI.add("parallel",function(a){a.Parallel=function(b){this.config=b||{};this.results=[];this.context=this.config.context||a;this.total=0;this.finished=0;};a.Parallel.prototype={results:null,total:null,finished:null,add:function(c){var b=this;b.total+=1;return function(){b.finished++;b.results.push(c&&c.apply(b.context,arguments));b.test();};},test:function(){var b=this;if(b.finished>=b.total&&b.callback){b.callback.call(b.context,b.results,b.data);}},done:function(c,b){this.callback=c;this.data=b;this.test();}};},"3.5.0",{requires:["yui-base"]});