// 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 navScale = this.fluidbook.resize.navScale;\r
+ var initialHeight = 20 * navScale; // Buffer in line height away from icons\r
+ var hStep = 25 * navScale; // The step height - the difference in height between the icon label lines\r
+ var h = initialHeight + ($(tooltipSelector).length - 1) * hStep;\r
var ww = $(window).width();\r
\r
$(tooltips).each(function() {\r
}\r
\r
var icon = $(this).find('.nav-icon:visible:first'); // Must get first visible icon so "toggle" icons work\r
- if(icon.length>0) {\r
- var offset = icon.offset();\r
-\r
- var left;\r
+ if (icon.length > 0) {\r
+ var offset = icon.offset(),\r
+ iconWidth = icon.outerWidth() * navScale,\r
+ left;\r
\r
if ($this.fluidbook.l10n.dir == 'ltr') {\r
- left = offset.left + (icon.outerWidth() / 2);\r
+ left = offset.left + (iconWidth / 2);\r
} else {\r
- left = (ww - offset.left - (icon.outerWidth() / 2)) * -1;\r
+ left = (ww - offset.left - (iconWidth / 2)) * -1;\r
}\r
\r
+ // Since the outer container has been scaled, we need to factor that in\r
+ // for the left position so the lines still meet with the icons\r
+ left = left / navScale;\r
+\r
var c = 'nav';\r
if ($(this).parents("#afterSearch").length > 0) {\r
c = 'afterSearch';\r
}\r
help += '<div class="icon ' + c + '" style="padding-top:' + h + 'px;left:' + left + 'px;"><span>' + text + '</span></div>';\r
- h -= 25;\r
+ h -= hStep;\r
}\r
});\r
- // $("#horizontalNav").transform({\r
- // scale: [scale, scale]\r
- // }, {\r
- // preserve: true\r
- // });\r
+\r
help += '</div>';\r
\r
// Interface\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
+ bottom: (hh - sliderCursor.offset().top) * navScale,\r
+ left: sliderCursor.offset().left + (sliderCursor.width() / 2 * navScale),\r
+ transformOrigin: '0 0'\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
- .transform({\r
- scale: [navScale, navScale],\r
- origin: ['0%', '0%']\r
+ this.view.find('#icons').css({\r
+ 'top': menuHeightScaled,\r
+ 'transform': 'scale('+ navScale +')',\r
+ 'transformOrigin': '0 100%'\r
});\r
\r
$("#helpView #icons").css({\r
fontSize: (14 / navScale) * interfaceScale\r
});\r
\r
- $("#helpView .illustration").transform({\r
- scale: [interfaceScale, interfaceScale],\r
- origin: ['50%', '50%']\r
+ // $("#helpView .illustration").transform({\r
+ // scale: [interfaceScale, interfaceScale],\r
+ // origin: ['50%', '50%']\r
+ // });\r
+\r
+ this.view.find('.illustration').css({\r
+ transform: 'translate(-50%, -50%) scale('+ interfaceScale +')'\r
});\r
\r
- $("#helpView .interface").find('.last,.next,.first,.previous').transform({\r
+ // ToDo: refactor bookmarkLabel code so that a scale transform can be applied without messing up positioning (wrap all 3 elements in a div? Handle RTL differences)\r
+\r
+ $("#helpView .interface").find('> div').transform({\r
scale: [interfaceScale, interfaceScale]\r
})\r
\r
+ // ToDo: refactor this and try to move transform-origins to CSS. Make sure that .first and .last label positions factor in interfaceScale\r
+\r
$("#helpView .interface").find('.last').transform({\r
origin: ['100%', '100%']\r
}, {\r
preserve: true\r
});\r
\r
- this.view.find('.illustration').css('margin-top', (hh - 200 * interfaceScale) / 2);\r
+ //this.view.find('.illustration').css('margin-top', (hh - 200 * interfaceScale) / 2);\r
},\r
clearTimeout: function() {\r
clearTimeout(this.autoTimeout);\r
this.textScale = 2;
this.bookScale = 1;
this.interfaceScale = 1;
+ this.navScale = 1;
this.ww = $(window).width();
this.hh = $(window).height();
this.init();
this.interfaceScale = interfaceScale;
var navScale = interfaceScale * parseInt(this.fluidbook.datas.mobileNavScale) / 100;
+ this.navScale = navScale;
+
var cssInterfaceScale = [interfaceScale, interfaceScale];
var cssNavScale = [navScale, navScale];
bottom: audioButtonPosition
});
- $("#nav,#logo,footer,#searchHints").transform({
+ $("#logo,footer,#searchHints").transform({
scale: navScale
});
+ // Scale horizontal size and positioning. Transform origin is handled in CSS for LTR/RTL variations
+ $('#horizontalNav').css({
+ 'transform': 'translateY(-'+ 50 * navScale +'%) scale('+ navScale +')'
+ })
+
var headerHeight = this.fluidbook.datas.menuHeight * navScale;
$('header').css({
height: headerHeight,