Ticket #5917: 5917.patch
| File 5917.patch, 3.0 kB (added by haysmark, 11 months ago) |
|---|
-
form/_FormWidget.js
316 316 this.setValue(this._lastValueReported, false); 317 317 }, 318 318 319 _valueChanged: function(){ 320 var v = this.getValue(); 321 var lv = this._lastValueReported; 322 // Equality comparison of objects such as dates are done by reference so 323 // two distinct objects are != even if they have the same data. So use 324 // toStrings in case the values are objects. 325 return ((v !== null && (v !== undefined) && v.toString)?v.toString():null) !== ((lv !== null && (lv !== undefined) && lv.toString)?lv.toString():null); 326 }, 327 319 328 _onKeyPress: function(e){ 320 329 if(e.keyCode == dojo.keys.ESCAPE && !e.shiftKey && !e.ctrlKey && !e.altKey){ 321 var v = this.getValue(); 322 var lv = this._lastValueReported; 323 // Equality comparison of objects such as dates are done by reference so 324 // two distinct objects are != even if they have the same data. So use 325 // toStrings in case the values are objects. 326 if(((v !== null && (v !== undefined) && v.toString)?v.toString():null) !== ((lv !== null && (lv !== undefined) && lv.toString)?lv.toString():null)){ 330 if(this._valueChanged()){ 327 331 this.undo(); 328 332 dojo.stopEvent(e); 329 333 return false; -
form/ComboBox.js
76 76 77 77 baseClass:"dijitComboBox", 78 78 79 _lastDisplayedValue: "",80 81 setDisplayedValue:function(/*String*/ value){82 this._lastDisplayedValue = value;83 this.setValue(value, true);84 },85 86 79 _getCaretPos: function(/*DomNode*/ element){ 87 80 // khtml 3.5.2 has selection* methods as does webkit nightlies from 2005-06-22 88 81 var pos = 0; … … 258 251 this._prev_key_backspace = false; 259 252 this._prev_key_esc = true; 260 253 this._hideResultList(); 261 if(this._lastDisplayedValue != this.getDisplayedValue()){ 262 this.setDisplayedValue(this._lastDisplayedValue); 263 dojo.stopEvent(evt); 264 }else{ 265 this.setValue(this.getValue(), false); 266 } 254 this.inherited(arguments); 267 255 break; 268 256 269 257 case dk.DELETE: -
form/FilteringSelect.js
38 38 39 39 _isvalid:true, 40 40 41 _lastDisplayedValue: "", 42 41 43 isValid:function(){ 42 44 return this._isvalid; 43 45 }, … … 217 219 setAttribute: function(/*String*/ attr, /*anything*/ value){ 218 220 dijit.form.MappedTextBox.prototype.setAttribute.apply(this, arguments); 219 221 dijit.form.ComboBoxMixin.prototype._setAttribute.apply(this, arguments); 222 }, 223 224 undo: function(){ 225 this.setDisplayedValue(this._lastDisplayedValue); 226 }, 227 228 _valueChanged: function(){ 229 return this.getDisplayedValue()!=this._lastDisplayedValue; 220 230 } 221 231 } 222 232 );