Project

General

Profile

Statistics
| Revision:

root / trunk / web / dojo / dijit / form / CurrencyTextBox.js

History | View | Annotate | Download (1.08 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["dijit.form.CurrencyTextBox"]){
9
dojo._hasResource["dijit.form.CurrencyTextBox"]=true;
10
dojo.provide("dijit.form.CurrencyTextBox");
11
dojo.require("dojo.currency");
12
dojo.require("dijit.form.NumberTextBox");
13
dojo.declare("dijit.form.CurrencyTextBox",dijit.form.NumberTextBox,{currency:"",baseClass:"dijitTextBox dijitCurrencyTextBox",regExpGen:function(_1){
14
return "("+(this._focused?this.inherited(arguments,[dojo.mixin({},_1,this.editOptions)])+"|":"")+dojo.currency.regexp(_1)+")";
15
},_formatter:dojo.currency.format,parse:function(_2,_3){
16
var v=dojo.currency.parse(_2,_3);
17
if(isNaN(v)&&/\d+/.test(_2)){
18
return this.inherited(arguments,[_2,dojo.mixin({},_3,this.editOptions)]);
19
}
20
return v;
21
},_setConstraintsAttr:function(_4){
22
if(!_4.currency&&this.currency){
23
_4.currency=this.currency;
24
}
25
this.inherited(arguments,[dojo.currency._mixInDefaults(dojo.mixin(_4,{exponent:false}))]);
26
}});
27
}