Debian Codegraph @

dojox/mobile/bidi/_ItemBase.js

raw symbols SCIP
1 define([
2 "dojo/_base/declare",
3 "./common"
4 ], function(declare, common){
5
6 // module:
7 // dojox/mobile/bidi/_ItemBase
8
9 return declare(null, {
10 // summary:
11 // Support for control over text direction for mobile _ItemBase widget, using Unicode Control Characters to control text direction.
12 // description:
13 // Implementation for text direction support for Label.
14 // This class should not be used directly.
15 // Mobile _ItemBase loads this module when user sets "has: {'dojo-bidi': true }" in data-dojo-config.
16 _setLabelAttr: function(/*String*/ text){
17 this._set("label", text);
18 this.labelNode.innerHTML = this._cv ? this._cv(text) : text;
19 if (!this.textDir){
20 var p = this.getParent();
21 this.textDir = p && p.get("textDir") ? p.get("textDir") : "";
22 }
23 this.labelNode.innerHTML = common.enforceTextDirWithUcc(this.labelNode.innerHTML, this.textDir);
24 },
25 _setTextDirAttr: function(/*String*/ textDir){
26 if(!this._created || this.textDir !== textDir){
27 this._set("textDir", textDir);
28 this.labelNode.innerHTML = common.enforceTextDirWithUcc(common.removeUCCFromText(this.labelNode.innerHTML), this.textDir);
29 if(this.badgeObj && this.badgeObj.setTextDir){ this.badgeObj.setTextDir(textDir); }
30 }
31 },
32 getTransOpts: function(){
33 var opts = this.inherited(arguments);
34 if(!this.isLeftToRight()){
35 opts.transitionDir = opts.transitionDir * -1;
36 }
37 return opts;
38 }
39 });
40 });