[Dojo-checkins] doughays - r16432 - dijit/trunk/form

dojo-checkins-admin at dojotoolkit.org dojo-checkins-admin at dojotoolkit.org
Wed Jan 21 14:54:10 UTC 2009


Author: doughays
Date: Wed Jan 21 06:54:07 2009
New Revision: 16432

Modified:
   dijit/trunk/form/NumberTextBox.js
Log:
References #7994.  Reformat the textbox input onfocus.

Modified: dijit/trunk/form/NumberTextBox.js
==============================================================================
--- dijit/trunk/form/NumberTextBox.js	(original)
+++ dijit/trunk/form/NumberTextBox.js	Wed Jan 21 06:54:07 2009
@@ -30,6 +30,14 @@
 
 		_formatter: dojo.number.format,
 
+		_onFocus: function(){
+			var val = this.attr('value');
+			if(typeof val == "number" && !isNaN(val)){
+				this.textbox.value = this.format(val, this.constraints);
+			}
+			this.inherited(arguments);
+		},
+
 		format: function(/*Number*/ value, /*dojo.number.__FormatOptions*/ constraints){
 			//	summary: formats the value as a Number, according to constraints
 


More information about the Dojo-checkins mailing list