| 1 |
define([ |
| 2 |
"dojo/_base/array", |
| 3 |
"dojo/_base/declare", |
| 4 |
"./common" |
| 5 |
], function(array, declare, common){ |
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
return declare(null, { |
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
postCreate: function(){ |
| 19 |
this.inherited(arguments); |
| 20 |
if(this.textDir){ |
| 21 |
this._applyTextDirToTextElements(); |
| 22 |
} |
| 23 |
}, |
| 24 |
buildRendering: function(){ |
| 25 |
this.inherited(arguments); |
| 26 |
|
| 27 |
if(!this.isLeftToRight()){ |
| 28 |
this.arrow.style.left = "0px"; |
| 29 |
} |
| 30 |
}, |
| 31 |
|
| 32 |
_setTextDirAttr: function(textDir){ |
| 33 |
if(textDir && this.textDir !== textDir){ |
| 34 |
this.textDir = textDir; |
| 35 |
this._applyTextDirToTextElements(); |
| 36 |
} |
| 37 |
}, |
| 38 |
|
| 39 |
_applyTextDirToTextElements: function(){ |
| 40 |
|
| 41 |
|
| 42 |
array.forEach(this.domNode.childNodes, function(node){ |
| 43 |
var currentNode = (node.nodeType === 1 && node.childNodes.length === 1) ? node.firstChild : node; |
| 44 |
if(currentNode.nodeType === 3 && currentNode.nodeValue){ |
| 45 |
if(currentNode.nodeValue.search(/[.\S]/) != -1){ |
| 46 |
currentNode.nodeValue = common.removeUCCFromText(currentNode.nodeValue); |
| 47 |
currentNode.nodeValue = common.enforceTextDirWithUcc(currentNode.nodeValue, this.textDir); |
| 48 |
} |
| 49 |
} |
| 50 |
}, this); |
| 51 |
} |
| 52 |
}); |
| 53 |
}); |
| 54 |
|