1 | define([ |
---|
2 | "dojo/_base/declare", |
---|
3 | "./common" |
---|
4 | ], function(declare, common){ |
---|
5 | |
---|
6 | // module: |
---|
7 | // dojox/mobile/bidi/Heading |
---|
8 | |
---|
9 | return declare(null, { |
---|
10 | // summary: |
---|
11 | // Support for control over text direction for mobile Heading widget, using Unicode Control Characters to control text direction. |
---|
12 | // description: |
---|
13 | // Implementation for text direction support for Label and Back. |
---|
14 | // This class should not be used directly. |
---|
15 | // Mobile Heading widget loads this module when user sets "has: {'dojo-bidi': true }" in data-dojo-config. |
---|
16 | _setLabelAttr: function(label){ |
---|
17 | this.inherited(arguments); |
---|
18 | if(this.getTextDir(label) === "rtl"){ this.domNode.style.direction = "rtl"; } //for text-overflow: ellipsis; |
---|
19 | this.labelDivNode.innerHTML = common.enforceTextDirWithUcc(this.labelDivNode.innerHTML, this.textDir); |
---|
20 | }, |
---|
21 | |
---|
22 | _setBackAttr: function(back){ |
---|
23 | this.inherited(arguments); |
---|
24 | this.backButton.labelNode.innerHTML = common.enforceTextDirWithUcc(this.backButton.labelNode.innerHTML, this.textDir); |
---|
25 | this.labelNode.innerHTML = this.labelDivNode.innerHTML; |
---|
26 | }, |
---|
27 | |
---|
28 | _setTextDirAttr: function( textDir){ |
---|
29 | if(!this._created || this.textDir != textDir){ |
---|
30 | this._set("textDir", textDir); |
---|
31 | if(this.getTextDir(this.labelDivNode.innerHTML) === "rtl"){ this.domNode.style.direction = "rtl"; }//for text-overflow: ellipsis; |
---|
32 | this.labelDivNode.innerHTML = common.enforceTextDirWithUcc(common.removeUCCFromText(this.labelDivNode.innerHTML), this.textDir); |
---|
33 | common.setTextDirForButtons(this); |
---|
34 | } |
---|
35 | } |
---|
36 | }); |
---|
37 | }); |
---|
38 | |
---|