| 1 |
define([ |
| 2 |
"dojo/_base/declare", |
| 3 |
"dojo/_base/window", |
| 4 |
"dojo/_base/array", |
| 5 |
"dojo/dom-construct", |
| 6 |
"./common" |
| 7 |
], function(declare, win, array, domConstruct, common){ |
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
return declare(null, { |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
postCreate: function(){ |
| 19 |
this.inherited(arguments); |
| 20 |
if(!this.textDir && this.getParent() && this.getParent().get("textDir")){ |
| 21 |
this.set("textDir", this.getParent().get("textDir")); |
| 22 |
} |
| 23 |
}, |
| 24 |
|
| 25 |
_setTextDirAttr: function(textDir){ |
| 26 |
if(textDir && (!this._created || this.textDir !== textDir)){ |
| 27 |
this.textDir = textDir; |
| 28 |
this._setTextDirToNodes(this.textDir); |
| 29 |
} |
| 30 |
}, |
| 31 |
|
| 32 |
_setTextDirToNodes: function(textDir){ |
| 33 |
array.forEach(this.panelNodes, function(panel){ |
| 34 |
array.forEach(panel.childNodes, function(node, i){ |
| 35 |
node.innerHTML = common.removeUCCFromText(node.innerHTML); |
| 36 |
node.innerHTML = common.enforceTextDirWithUcc(node.innerHTML, this.textDir); |
| 37 |
node.style.textAlign = (this.dir.toLowerCase() === "rtl") ? "right" : "left"; |
| 38 |
}, this); |
| 39 |
}, this); |
| 40 |
} |
| 41 |
}); |
| 42 |
}); |