Changeset 13267
- Timestamp:
- 04/04/08 13:45:59 (9 months ago)
- Location:
- dijit/trunk
- Files:
-
- 2 modified
-
tests/form/test_TimeTextBox.html (modified) (1 diff)
-
_TimePicker.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dijit/trunk/tests/form/test_TimeTextBox.html
r12730 r13267 121 121 </div> 122 122 123 <div class="dojoTitlePaneLabel"> 124 <label for="q6"> Hover-based scrolling 12 Hour Time </label> 125 <span class="noticeMessage">TimeTextBox class, 126 Attributes: {hoverScroll: true, timePattern:'h:mm:ss a'}</span> 127 </div> 128 <div class="testExample"> 129 <input id="q6" type="text" name="timeauto" class="medium" value="T17:45:00" 130 dojoType="dijit.form.TimeTextBox" 131 constraints="{hoverScroll: true, timePattern:'h:mm:ss a'}" 132 required="true" 133 invalidMessage="Invalid time." /> 134 </div> 135 123 136 <script> 124 137 function displayData() { -
dijit/trunk/_TimePicker.js
r13266 r13267 20 20 // see dijit._TimePicker.visibleRange 21 21 visibleRange: "T05:00:00" 22 23 // hoverScroll: Boolean 24 // see dijit._TimePicker.hoverScroll 22 25 } 23 26 ); … … 55 58 // Example: `T05:00:00` displays 5 hours of options 56 59 visibleRange: "T05:00:00", 60 61 // hoverScroll: Boolean 62 // Specifying true here will have the time picker scroll by only 63 // hovering on the arrow buttons - rather than needing to click 64 // them. It is accomplished by kicking off a typematic trigger 65 // when the buttons are hovered. 66 hoverScroll: false, 57 67 58 68 // value: String … … 158 168 //dijit.typematic.addListener(this.upArrow,this.timeMenu, {keyCode:dojo.keys.UP_ARROW,ctrlKey:false,altKey:false,shiftKey:false}, this, "_onArrowUp", 0.8, 500); 159 169 //dijit.typematic.addListener(this.downArrow, this.timeMenu, {keyCode:dojo.keys.DOWN_ARROW,ctrlKey:false,altKey:false,shiftKey:false}, this, "_onArrowDown", 0.8,500); 160 170 171 if(this.hoverScroll){ 172 // Connect some callback functions to the hover event of the arrows 173 var triggerFx = function(cb){ 174 return function(cnt){ 175 // don't run on the first firing 176 if(cnt > 0){cb.call(this, arguments);} 177 }; 178 }; 179 var hoverFx = function(node, cb){ 180 return function(e){ 181 dojo.stopEvent(e); 182 dijit.typematic.trigger(e, this, node, triggerFx(cb), node, 0.85, 250); 183 }; 184 }; 185 this.connect(this.upArrow, "onmouseover", hoverFx(this.upArrow, this._onArrowUp)); 186 this.connect(this.downArrow, "onmouseover", hoverFx(this.downArrow, this._onArrowDown)); 187 } 188 161 189 this.inherited(arguments); 162 190 this.setValue(this.value);