Debian Codegraph @

dojox/charting/bidi/axis2d/Default.js

raw symbols SCIP
1 define(["dojo/_base/declare", "dojo/dom-style"],
2 function(declare, domStyle){
3 // module:
4 // dojox/charting/bidi/axis2d/Default
5 return declare(null, {
6 labelTooltip: function(elem, chart, label, truncatedLabel, font, elemType){
7 // additional preprocessing of the labels, needed for rtl base text direction in LTR
8 // GUI, or for ltr base text direction for RTL GUI.
9
10 var isChartDirectionRtl = (domStyle.get(chart.node,"direction") == "rtl");
11 var isBaseTextDirRtl = (chart.getTextDir(label) == "rtl");
12
13 if(isBaseTextDirRtl && !isChartDirectionRtl){
14 label = "<span dir='rtl'>" + label +"</span>";
15 }
16 if(!isBaseTextDirRtl && isChartDirectionRtl){
17 label = "<span dir='ltr'>" + label +"</span>";
18 }
19 this.inherited(arguments);
20 },
21
22 _isRtl: function(){
23 return this.chart.isRightToLeft();
24 }
25 });
26 });
27