Project

General

Profile

Statistics
| Revision:

root / trunk / web / dojo / dojox / form / manager / _EnableMixin.js

History | View | Annotate | Download (1.17 KB)

1 9 andrej.cim
/*
2
        Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
3
        Available via Academic Free License >= 2.1 OR the modified BSD license.
4
        see: http://dojotoolkit.org/license for details
5
*/
6
7
8
if(!dojo._hasResource["dojox.form.manager._EnableMixin"]){
9
dojo._hasResource["dojox.form.manager._EnableMixin"]=true;
10
dojo.provide("dojox.form.manager._EnableMixin");
11
dojo.require("dojox.form.manager._Mixin");
12
(function(){
13
var fm=dojox.form.manager,aa=fm.actionAdapter,ia=fm.inspectorAdapter;
14
dojo.declare("dojox.form.manager._EnableMixin",null,{gatherEnableState:function(_1){
15
var _2=this.inspectFormWidgets(ia(function(_3,_4){
16
return !_4.attr("disabled");
17
}),_1);
18
if(this.inspectFormNodes){
19
dojo.mixin(_2,this.inspectFormNodes(ia(function(_5,_6){
20
return !dojo.attr(_6,"disabled");
21
}),_1));
22
}
23
return _2;
24
},enable:function(_7,_8){
25
if(arguments.length<2||_8===undefined){
26
_8=true;
27
}
28
this.inspectFormWidgets(aa(function(_9,_a,_b){
29
_a.attr("disabled",!_b);
30
}),_7,_8);
31
if(this.inspectFormNodes){
32
this.inspectFormNodes(aa(function(_c,_d,_e){
33
dojo.attr(_d,"disabled",!_e);
34
}),_7,_8);
35
}
36
return this;
37
},disable:function(_f){
38
var _10=this.gatherEnableState();
39
this.enable(_f,false);
40
return _10;
41
}});
42
})();
43
}