Debian Codegraph @

dojox/mobile/bidi/IconItem.js

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