From 900a3a9ad21fed07a656ad30aaa9828b7a7264ce Mon Sep 17 00:00:00 2001 From: Bill Keese Date: Mon, 8 Apr 2013 09:16:37 +0900 Subject: [PATCH] TextBox, MappedTextBox, DropDownBox: remove deprecated API's, refs #4: - remove deprecated methods (setDisplayedValue, getDisplayedValue) - remove nameAttrSetting variable; it was only needed for IE6/IE7 --- form/MappedTextBox.js | 18 ++---------------- form/TextBox.js | 30 +++++------------------------- form/templates/DropDownBox.html | 2 +- form/templates/TextBox.html | 2 +- 4 files changed, 9 insertions(+), 43 deletions(-) diff --git a/form/MappedTextBox.js b/form/MappedTextBox.js index 955fa29fd..537405427 100644 --- a/form/MappedTextBox.js +++ b/form/MappedTextBox.js @@ -1,9 +1,8 @@ define([ "dojo/_base/declare", // declare - "dojo/sniff", // has("msapp") "dojo/dom-construct", // domConstruct.place "./ValidationTextBox" -], function(declare, has, domConstruct, ValidationTextBox){ +], function(declare, domConstruct, ValidationTextBox){ // module: // dijit/form/MappedTextBox @@ -22,14 +21,6 @@ define([ // tags: // protected - postMixInProperties: function(){ - this.inherited(arguments); - - // We want the name attribute to go to the hidden , not the displayed , - // so override _FormWidget.postMixInProperties() setting of nameAttrSetting for IE. - this.nameAttrSetting = ""; - }, - // Remap name attribute to be mapped to hidden node created in buildRendering(), rather than this.focusNode _setNameAttr: "valueNode", @@ -67,12 +58,7 @@ define([ // Create a hidden node with the serialized value used for submit // (as opposed to the displayed value). - // Passing in name as markup rather than relying on _setNameAttr custom setter above - // to make query(input[name=...]) work on IE. (see #8660). - // But not doing that for Windows 8 Store apps because it causes a security exception (see #16452). - this.valueNode = domConstruct.place("", - this.textbox, "after"); + this.valueNode = domConstruct.place("", this.textbox, "after"); }, reset: function(){ diff --git a/form/TextBox.js b/form/TextBox.js index 511566ed7..46a7e57e5 100644 --- a/form/TextBox.js +++ b/form/TextBox.js @@ -2,16 +2,14 @@ define([ "dojo/_base/declare", // declare "dojo/dom-construct", // domConstruct.create "dojo/dom-style", // domStyle.getComputedStyle - "dojo/_base/kernel", // kernel.deprecated "dojo/_base/lang", // lang.hitch "dojo/on", "dojo/sniff", // has("ie") has("mozilla") "./_FormValueWidget", "./_TextBoxMixin", - "dojo/text!./templates/TextBox.html", - "../main" // to export dijit._setSelectionRange, remove in 2.0 -], function(declare, domConstruct, domStyle, kernel, lang, on, has, - _FormValueWidget, _TextBoxMixin, template, dijit){ + "dojo/text!./templates/TextBox.html" +], function(declare, domConstruct, domStyle, lang, on, has, + _FormValueWidget, _TextBoxMixin, template){ // module: // dijit/form/TextBox @@ -21,7 +19,7 @@ define([ // A base class for textbox form inputs templateString: template, - _singleNodeTemplate: '', + _singleNodeTemplate: '', _buttonInputDisabled: has("ie") ? "disabled" : "", // allows IE to disallow focus, but Firefox cannot be disabled for mousedown events @@ -99,24 +97,6 @@ define([ this._updatePlaceHolder(); }, - getDisplayedValue: function(){ - // summary: - // Deprecated. Use get('displayedValue') instead. - // tags: - // deprecated - kernel.deprecated(this.declaredClass+"::getDisplayedValue() is deprecated. Use get('displayedValue') instead.", "", "2.0"); - return this.get('displayedValue'); - }, - - setDisplayedValue: function(/*String*/ value){ - // summary: - // Deprecated. Use set('displayedValue', ...) instead. - // tags: - // deprecated - kernel.deprecated(this.declaredClass+"::setDisplayedValue() is deprecated. Use set('displayedValue', ...) instead.", "", "2.0"); - this.set('displayedValue', value); - }, - _onBlur: function(e){ if(this.disabled){ return; } this.inherited(arguments); @@ -145,7 +125,7 @@ define([ }; // Overrides definition of _setSelectionRange from _TextBoxMixin (TODO: move to _TextBoxMixin.js?) - dijit._setSelectionRange = _TextBoxMixin._setSelectionRange = function(/*DomNode*/ element, /*Number?*/ start, /*Number?*/ stop){ + _TextBoxMixin._setSelectionRange = function(/*DomNode*/ element, /*Number?*/ start, /*Number?*/ stop){ if(element.createTextRange){ var r = element.createTextRange(); r.collapse(true); diff --git a/form/templates/DropDownBox.html b/form/templates/DropDownBox.html index 7c6881cf1..1c8b9b711 100644 --- a/form/templates/DropDownBox.html +++ b/form/templates/DropDownBox.html @@ -12,7 +12,7 @@ >
diff --git a/form/templates/TextBox.html b/form/templates/TextBox.html index fd543c695..232b7fbef 100644 --- a/form/templates/TextBox.html +++ b/form/templates/TextBox.html @@ -1,6 +1,6 @@