1 | define([ |
---|
2 | "dojo/_base/declare", |
---|
3 | "dojo/dom-construct", |
---|
4 | "dijit/_WidgetBase", |
---|
5 | "dijit/form/_FormValueMixin", |
---|
6 | "dijit/form/_TextBoxMixin" |
---|
7 | ], function(declare, domConstruct, WidgetBase, FormValueMixin, TextBoxMixin){ |
---|
8 | |
---|
9 | /*===== |
---|
10 | WidgetBase = dijit._WidgetBase; |
---|
11 | FormValueMixin = dijit.form._FormValueMixin; |
---|
12 | TextBoxMixin = dijit.form._TextBoxMixin; |
---|
13 | =====*/ |
---|
14 | return declare("dojox.mobile.TextBox",[WidgetBase, FormValueMixin, TextBoxMixin],{ |
---|
15 | // summary: |
---|
16 | // A non-templated base class for textbox form inputs |
---|
17 | |
---|
18 | baseClass: "mblTextBox", |
---|
19 | |
---|
20 | // Override automatic assigning type --> node, it causes exception on IE8. |
---|
21 | // Instead, type must be specified as this.type when the node is created, as part of the original DOM |
---|
22 | _setTypeAttr: null, |
---|
23 | |
---|
24 | // Map widget attributes to DOMNode attributes. |
---|
25 | _setPlaceHolderAttr: "textbox", |
---|
26 | |
---|
27 | buildRendering: function(){ |
---|
28 | if(!this.srcNodeRef){ |
---|
29 | this.srcNodeRef = domConstruct.create("input", {"type":this.type}); |
---|
30 | } |
---|
31 | this.inherited(arguments); |
---|
32 | this.textbox = this.focusNode = this.domNode; |
---|
33 | }, |
---|
34 | |
---|
35 | postCreate: function(){ |
---|
36 | this.inherited(arguments); |
---|
37 | this.connect(this.textbox, "onfocus", "_onFocus"); |
---|
38 | this.connect(this.textbox, "onblur", "_onBlur"); |
---|
39 | } |
---|
40 | }); |
---|
41 | }); |
---|