From f0cfe83e3725f9a3928da97a6e3085e79cb25309 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 18 Mar 2013 10:26:24 +0400 Subject: upgrade dojo to 1.8.3 (refs #570) --- lib/dijit/form/TimeTextBox.js.uncompressed.js | 79 +++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 lib/dijit/form/TimeTextBox.js.uncompressed.js (limited to 'lib/dijit/form/TimeTextBox.js.uncompressed.js') diff --git a/lib/dijit/form/TimeTextBox.js.uncompressed.js b/lib/dijit/form/TimeTextBox.js.uncompressed.js new file mode 100644 index 000000000..ba81e1acd --- /dev/null +++ b/lib/dijit/form/TimeTextBox.js.uncompressed.js @@ -0,0 +1,79 @@ +define("dijit/form/TimeTextBox", [ + "dojo/_base/declare", // declare + "dojo/keys", // keys.DOWN_ARROW keys.ENTER keys.ESCAPE keys.TAB keys.UP_ARROW + "dojo/_base/lang", // lang.hitch + "../_TimePicker", + "./_DateTimeTextBox" +], function(declare, keys, lang, _TimePicker, _DateTimeTextBox){ + + // module: + // dijit/form/TimeTextBox + + + /*===== + var __Constraints = declare([_DateTimeTextBox.__Constraints, _TimePicker.__Constraints], { + }); + =====*/ + + return declare("dijit.form.TimeTextBox", _DateTimeTextBox, { + // summary: + // A validating, serializable, range-bound time text box with a drop down time picker + + baseClass: "dijitTextBox dijitComboBox dijitTimeTextBox", + popupClass: _TimePicker, + _selector: "time", + +/*===== + // constraints: __Constraints + constraints:{}, +=====*/ + + // value: Date + // The value of this widget as a JavaScript Date object. Note that the date portion implies time zone and daylight savings rules. + // + // Example: + // | new dijit/form/TimeTextBox({value: stamp.fromISOString("T12:59:59", new Date())}) + // + // When passed to the parser in markup, must be specified according to locale-independent + // `stamp.fromISOString` format. + // + // Example: + // | + value: new Date(""), // value.toString()="NaN" + //FIXME: in markup, you have no control over daylight savings + + _onKey: function(evt){ + if(this.disabled || this.readOnly){ return; } + this.inherited(arguments); + + // If the user has backspaced or typed some numbers, then filter the result list + // by what they typed. Maybe there's a better way to detect this, like _handleOnChange()? + switch(evt.keyCode){ + case keys.ENTER: + case keys.TAB: + case keys.ESCAPE: + case keys.DOWN_ARROW: + case keys.UP_ARROW: + // these keys have special meaning + break; + default: + // defer() because the keystroke hasn't yet appeared in the , + // so the get('displayedValue') call below won't give the result we want. + this.defer(function(){ + // set this.filterString to the filter to apply to the drop down list; + // it will be used in openDropDown() + var val = this.get('displayedValue'); + this.filterString = (val && !this.parse(val, this.constraints)) ? val.toLowerCase() : ""; + + // close the drop down and reopen it, in order to filter the items shown in the list + // and also since the drop down may need to be repositioned if the number of list items has changed + // and it's being displayed above the + if(this._opened){ + this.closeDropDown(); + } + this.openDropDown(); + }); + } + } + }); +}); -- cgit v1.2.3