vendor/assets/javascripts/dojo/behavior.js in dojo-rails-0.9.9 vs vendor/assets/javascripts/dojo/behavior.js in dojo-rails-0.9.10
- old
+ new
@@ -4,89 +4,91 @@
see: http://dojotoolkit.org/license for details
*/
//>>built
define("dojo/behavior",["./_base/kernel","./_base/lang","./_base/array","./_base/connect","./query","./ready"],function(_1,_2,_3,_4,_5,_6){
-_1.behavior=new function(){
-function _7(_8,_9){
-if(!_8[_9]){
-_8[_9]=[];
+_1.deprecated("dojo.behavior","Use dojo/on with event delegation (on.selector())");
+var _7=function(){
+function _8(_9,_a){
+if(!_9[_a]){
+_9[_a]=[];
}
-return _8[_9];
+return _9[_a];
};
-var _a=0;
-function _b(_c,_d,_e){
-var _f={};
-for(var x in _c){
-if(typeof _f[x]=="undefined"){
-if(!_e){
-_d(_c[x],x);
+var _b=0;
+function _c(_d,_e,_f){
+var _10={};
+for(var x in _d){
+if(typeof _10[x]=="undefined"){
+if(!_f){
+_e(_d[x],x);
}else{
-_e.call(_d,_c[x],x);
+_f.call(_e,_d[x],x);
}
}
}
};
this._behaviors={};
-this.add=function(_10){
-_b(_10,this,function(_11,_12){
-var _13=_7(this._behaviors,_12);
-if(typeof _13["id"]!="number"){
-_13.id=_a++;
+this.add=function(_11){
+_c(_11,this,function(_12,_13){
+var _14=_8(this._behaviors,_13);
+if(typeof _14["id"]!="number"){
+_14.id=_b++;
}
-var _14=[];
-_13.push(_14);
-if((_2.isString(_11))||(_2.isFunction(_11))){
-_11={found:_11};
+var _15=[];
+_14.push(_15);
+if((_2.isString(_12))||(_2.isFunction(_12))){
+_12={found:_12};
}
-_b(_11,function(_15,_16){
-_7(_14,_16).push(_15);
+_c(_12,function(_16,_17){
+_8(_15,_17).push(_16);
});
});
};
-var _17=function(_18,_19,_1a){
-if(_2.isString(_19)){
-if(_1a=="found"){
-_4.publish(_19,[_18]);
+var _18=function(_19,_1a,_1b){
+if(_2.isString(_1a)){
+if(_1b=="found"){
+_4.publish(_1a,[_19]);
}else{
-_4.connect(_18,_1a,function(){
-_4.publish(_19,arguments);
+_4.connect(_19,_1b,function(){
+_4.publish(_1a,arguments);
});
}
}else{
-if(_2.isFunction(_19)){
-if(_1a=="found"){
-_19(_18);
+if(_2.isFunction(_1a)){
+if(_1b=="found"){
+_1a(_19);
}else{
-_4.connect(_18,_1a,_19);
+_4.connect(_19,_1b,_1a);
}
}
}
};
this.apply=function(){
-_b(this._behaviors,function(_1b,id){
-_5(id).forEach(function(_1c){
-var _1d=0;
-var bid="_dj_behavior_"+_1b.id;
-if(typeof _1c[bid]=="number"){
-_1d=_1c[bid];
-if(_1d==(_1b.length)){
+_c(this._behaviors,function(_1c,id){
+_5(id).forEach(function(_1d){
+var _1e=0;
+var bid="_dj_behavior_"+_1c.id;
+if(typeof _1d[bid]=="number"){
+_1e=_1d[bid];
+if(_1e==(_1c.length)){
return;
}
}
-for(var x=_1d,_1e;_1e=_1b[x];x++){
-_b(_1e,function(_1f,_20){
-if(_2.isArray(_1f)){
-_3.forEach(_1f,function(_21){
-_17(_1c,_21,_20);
+for(var x=_1e,_1f;_1f=_1c[x];x++){
+_c(_1f,function(_20,_21){
+if(_2.isArray(_20)){
+_3.forEach(_20,function(_22){
+_18(_1d,_22,_21);
});
}
});
}
-_1c[bid]=_1b.length;
+_1d[bid]=_1c.length;
});
});
};
};
+_1.behavior=new _7();
_6(_1.behavior,"apply");
return _1.behavior;
});