source: Dev/trunk/src/client/dojox/mobile/bidi/TextBox.js

Last change on this file was 483, checked in by hendrikvanantwerpen, 11 years ago

Added Dojo 1.9.3 release.

File size: 1.4 KB
Line 
1define([
2        "dojo/_base/declare",
3        "dijit/_BidiSupport"  //load implementation for textDir from dijit (for editable widgets), (no direct references)
4], function(declare){
5
6        // module:
7        //              dojox/mobile/bidi/TextBox
8
9        return declare(null, {
10                // summary:
11                //              Support for control over text direction for mobile TextBox widget.
12                // description:
13                //              Implementation for text direction using HTML "dir" attribute (used for editable widgets).
14                //              This class should not be used directly.
15                //              Mobile TextBox widget loads this module when user sets "has: {'dojo-bidi': true }" in data-dojo-config.
16                _setTextDirAttr: function(/*String*/ textDir){
17                        if(!this._created || this.textDir != textDir){
18                                this._set("textDir", textDir);
19                                if(this.value){
20                                        this.applyTextDir(this.focusNode || this.textbox);
21                                }
22                                else{
23                                        this.applyTextDir(this.focusNode || this.textbox, this.textbox.getAttribute("placeholder"));
24                                }
25                        }
26                },
27
28                _setDirAttr: function(/*String*/ dir){
29                        if(!(this.textDir && this.textbox)){
30                                this.dir = dir;
31                        }
32                },
33
34                _onBlur: function(e){
35                        this.inherited(arguments);
36                        if(!this.textbox.value){
37                                this.applyTextDir(this.textbox, this.textbox.getAttribute("placeholder"));
38                        }
39                },
40
41                _onInput: function(e){
42                        this.inherited(arguments);
43                        if(!this.textbox.value){
44                                this.applyTextDir(this.textbox, this.textbox.getAttribute("placeholder"));
45                        }
46                }
47        });
48});
Note: See TracBrowser for help on using the repository browser.