diff options
author | Richard Beales <[email protected]> | 2013-03-18 07:32:01 +0000 |
---|---|---|
committer | Richard Beales <[email protected]> | 2013-03-18 07:32:01 +0000 |
commit | 7c97d17aaf373339a8bcd917ad59ca6018148f0d (patch) | |
tree | 5a3c04f0f9529be392c1263d3feb75806eb43797 /lib/dijit/form/_FormWidget.js.uncompressed.js | |
parent | 70db7424e7068701e60cc5bcdfe8f858be508179 (diff) | |
parent | c670a80ddd9b03bd4ea6d940a9ed682fd26248d7 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'lib/dijit/form/_FormWidget.js.uncompressed.js')
-rw-r--r-- | lib/dijit/form/_FormWidget.js.uncompressed.js | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/lib/dijit/form/_FormWidget.js.uncompressed.js b/lib/dijit/form/_FormWidget.js.uncompressed.js new file mode 100644 index 000000000..ada09eb0e --- /dev/null +++ b/lib/dijit/form/_FormWidget.js.uncompressed.js @@ -0,0 +1,71 @@ +define("dijit/form/_FormWidget", [ + "dojo/_base/declare", // declare + "dojo/has", // has("dijit-legacy-requires") + "dojo/_base/kernel", // kernel.deprecated + "dojo/ready", + "../_Widget", + "../_CssStateMixin", + "../_TemplatedMixin", + "./_FormWidgetMixin" +], function(declare, has, kernel, ready, _Widget, _CssStateMixin, _TemplatedMixin, _FormWidgetMixin){ + + +// module: +// dijit/form/_FormWidget + +// Back compat w/1.6, remove for 2.0 +if(has("dijit-legacy-requires")){ + ready(0, function(){ + var requires = ["dijit/form/_FormValueWidget"]; + require(requires); // use indirection so modules not rolled into a build + }); +} + +return declare("dijit.form._FormWidget", [_Widget, _TemplatedMixin, _CssStateMixin, _FormWidgetMixin], { + // summary: + // Base class for widgets corresponding to native HTML elements such as `<checkbox>` or `<button>`, + // which can be children of a `<form>` node or a `dijit/form/Form` widget. + // + // description: + // Represents a single HTML element. + // All these widgets should have these attributes just like native HTML input elements. + // You can set them during widget construction or afterwards, via `dijit/_WidgetBase.set()`. + // + // They also share some common methods. + + setDisabled: function(/*Boolean*/ disabled){ + // summary: + // Deprecated. Use set('disabled', ...) instead. + kernel.deprecated("setDisabled("+disabled+") is deprecated. Use set('disabled',"+disabled+") instead.", "", "2.0"); + this.set('disabled', disabled); + }, + + setValue: function(/*String*/ value){ + // summary: + // Deprecated. Use set('value', ...) instead. + kernel.deprecated("dijit.form._FormWidget:setValue("+value+") is deprecated. Use set('value',"+value+") instead.", "", "2.0"); + this.set('value', value); + }, + + getValue: function(){ + // summary: + // Deprecated. Use get('value') instead. + kernel.deprecated(this.declaredClass+"::getValue() is deprecated. Use get('value') instead.", "", "2.0"); + return this.get('value'); + }, + + postMixInProperties: function(){ + // Setup name=foo string to be referenced from the template (but only if a name has been specified) + // Unfortunately we can't use _setNameAttr to set the name due to IE limitations, see #8484, #8660. + // Regarding escaping, see heading "Attribute values" in + // http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.3.2 + this.nameAttrSetting = this.name ? ('name="' + this.name.replace(/"/g, """) + '"') : ''; + this.inherited(arguments); + }, + + // Override automatic assigning type --> focusNode, it causes exception on IE. + // Instead, type must be specified as ${type} in the template, as part of the original DOM + _setTypeAttr: null +}); + +}); |