// }, {\r
// preserve: true\r
// });\r
- var h = 20 + ($("#horizontalNav a[data-tooltip]").length - 1) * 25;\r
+\r
+ var tooltipSelector = '#horizontalNav a[data-tooltip]';\r
+\r
+ // When the menu position is inverted, the icon help lines need\r
+ // to be drawn in the reverse order to avoid text/line overlaps\r
+ var tooltips = this.fluidbook.datas.invertMenuPosition ? $(tooltipSelector).get().reverse() : $(tooltipSelector);\r
+ var h = 20 + ($(tooltipSelector).length - 1) * 25;\r
var ww = $(window).width();\r
\r
- $("#horizontalNav a[data-tooltip]").each(function() {\r
+ $(tooltips).each(function() {\r
var text = $(this).data('tooltip');\r
if (text == null || text == undefined || text == '' || $(this).hasClass('hidden')) {\r
return;\r
}\r
\r
this.view.html(help);\r
- resize();\r
+ //resize();\r
},\r
initEvents: function() {\r
var $this = this;\r
return false;\r
}\r
\r
- if (this.view.html() == '') {\r
- this.init();\r
- }\r
-\r
var $this = this;\r
\r
- resize(); // Main resize function that later calls local resize() here...\r
- this.overlay.show();\r
+ this.init(); // Re-run init because layout and options might have changed since last run\r
+ resize();\r
+ this.overlay.show();\r
this.view.show();\r
\r
$("body,#previous,#next").addClass('help');\r
},\r
resize: function(ww, hh, interfaceScale, navScale) {\r
\r
+ // Repopulate and reposition help overlay elements.\r
+ // Mostly important for the RTL languages where icon label position must be recalculated/\r
+ // ToDo: Replace this sledgehammer approach with something more elegant\r
+ this.init();\r
+\r
// ToDo: access variables from fluidbook.resize.* if they're not passed to the function. So resize function can be called directly...\r
\r
var $this = this;\r
top: this.interfaceTop\r
});\r
\r
- // Slider label - delay slightly to make sure co-ordinates are correct\r
- setTimeout(function () {\r
- var sliderHelp = $this.view.find('.slider');\r
- var sliderCursor = $('#slidercursor .visible');\r
- sliderHelp.css({\r
- bottom: hh - sliderCursor.offset().top,\r
- left: sliderCursor.offset().left + (sliderCursor.width() / 2)\r
- });\r
- }, 250);\r
+ // Slider label\r
+ var positionSliderLabel = function () {\r
+ var sliderHelp = $this.view.find('.slider');\r
+ var sliderCursor = $('#slidercursor .visible');\r
+ sliderHelp.css({\r
+ bottom: hh - sliderCursor.offset().top,\r
+ left: sliderCursor.offset().left + (sliderCursor.width() / 2)\r
+ });\r
+ };\r
+ positionSliderLabel(); // Run immediately\r
+ setTimeout(positionSliderLabel, 250); // delay slightly to make sure co-ordinates are correct\r
\r
$("#helpView #icons")\r
.css('top', menuHeightScaled)\r
position: absolute;
top: 0px;
display: inline-block;
- border-left: 1px solid #ffffff;
- padding-left: 0.5em;
white-space: nowrap;
+ padding: 0 0.5em;
+ border-color: #fff;
+ border-style: solid;
+ border-width: 0 0 0 1px; // Left border
+
+ // When in RTL default or LTR with menu inverted, the labels need to be on the other side of the line
+ .rtl.menu-default &, .ltr.menu-inverted & {
+ border-width: 0 1px 0 0; // Right border
+ transform: translateX(-100%); // Flip position back to where it would be if it was based on a left border line
+ }
}
.icon span {