// When the menu position is inverted, the icon help lines need
// to be drawn in the reverse order to avoid text/line overlaps
- var tooltips = this.fluidbook._boolean(this.fluidbook.settings.invertMenuPosition) ? $(tooltipSelector).get().reverse() : $(tooltipSelector);
+ var tooltips = this.fluidbook.nav.isInverted() ? $(tooltipSelector).get().reverse() : $(tooltipSelector);
var navScale = this.fluidbook.resize.navScale;
var initialHeight = 20 * navScale; // Buffer in line height away from icons
var hStep = 25 * navScale; // The step height - the difference in height between the icon label lines
}
if (this.fluidbook.bookmarks.enabled) {
- var inverted = this.fluidbook._boolean(this.fluidbook.settings.invertMenuPosition);
+ var inverted = this.fluidbook.nav.isInverted() ;
var side = ((this.fluidbook.l10n.dir === 'ltr' && inverted) || (this.fluidbook.l10n.dir === 'rtl' && !inverted)) ? 'left' : 'right';
if (this.fluidbook.mobilefirst.enabled) {
side = 'right';
return true;
}
- if (!this.fluidbook._boolean(this.fluidbook.settings.invertMenuPosition) && !this.fluidbook.getButtonsVisibility().next && this.fluidbook.contentlock.getMaxPage() % 2 === 0) {
+ if (!this.fluidbook.nav.isInverted() && !this.fluidbook.getButtonsVisibility().next && this.fluidbook.contentlock.getMaxPage() % 2 === 0) {
return false;
}
$('html').addClass('sharp');
}
- if (this._boolean(this.settings.invertMenuPosition)) {
+ if (this.nav.isInverted() ) {
$('html').addClass('menu-inverted');
} else {
$('html').addClass('menu-default');
}
+ if(this.nav.isLogoCentered()){
+ $('#logo').addClass('center');
+ }
+
$(document).on('fluidbook.init', function () {
var logoImg = $("#splash .logo img");
if ($(logoImg).isLoaded()) {
this.horizontalNav = $("#horizontalNav");
this._inited = {};
this.setNav('horizontalNav');
- if($("#iconList").html()!=='') {
+ if ($("#iconList").html() !== '') {
this.setNav('menu');
}
if (Modernizr.msie) {
}
FluidbookNav.prototype = {
+ isLogoCentered: function () {
+ return this.fluidbook.settings.invertMenuPosition >= 2;
+ },
+
+ isInverted: function () {
+ let v = this.fluidbook.settings.invertMenuPosition;
+ if (v === false || v === 'false' || v == 0 || v == 2) {
+ return false;
+ } else if (v === true || v === 'true' || v == 1 || v == 3) {
+ return true;
+ }
+ return false;
+ },
+
initMenu: function () {
var $this = this, dir = this.fluidbook.l10n.dir,
- inverted = this.fluidbook._boolean(this.fluidbook.settings.invertMenuPosition),
+ inverted = this.isInverted(),
side = ((dir === 'ltr' && inverted) || (dir === 'rtl' && !inverted)) ? 'right' : 'left';
var extensions = ['pagedim-black', 'position-front'];
transform: 'scale(' + (this.bookScale) + ')', top: this.fh, fontSize: 11.25 / this.bookScale
});
- if (this.fluidbook._boolean(this.fluidbook.settings.logoHideWhenOverriden)) {
- var availableWidthForLogo = (this.ww - this.fw) / 2;
- if ($("#logo").outerWidth() > availableWidthForLogo) {
- $("#logo").addClass('overridenByFluidbook');
- } else {
- $("#logo").removeClass('overridenByFluidbook');
- }
+ if (this.fluidbook.nav.isLogoCentered()) {
+ $("#logo").css('left', (this.ww - this.fluidbook.settings.logoDimensions[0]) / 2);
}
if (this.fluidbook.interface.arrowsEnabled()) {
resizeAfterSearch: function () {
var rect = $("#horizontalNav").get(0).getBoundingClientRect();
- var inverted = this.fluidbook._boolean(this.fluidbook.settings.invertMenuPosition)
+ var inverted = this.fluidbook.nav.isInverted()
if ((this.fluidbook.l10n.ltr && !inverted) || (this.fluidbook.l10n.rtl && inverted)) {
$("#afterSearch").css({left: rect.left + rect.width, right: 'auto'});
} else {
},
checkLogoVisibility: function () {
- if (this.fluidbook.mobilefirst.enabled) {
+ if (this.fluidbook.mobilefirst.enabled || !this.fluidbook.settings.logoHideWhenOverriden) {
return;
}
var logo = document.getElementById("logo").getBoundingClientRect();
var fluidbook = document.getElementById("fluidbook").getBoundingClientRect();
- var inverted = this.fluidbook._boolean(this.fluidbook.settings.invertMenuPosition);
+ var inverted = this.fluidbook.nav.isInverted();
var overlapY = logo.bottom > fluidbook.top;
var overlapX;
visibility: hidden;
}
+ &.center {
+ right: auto !important;
+ }
+
// Positioning for left-to-right Fluidbooks + inverted menu on RTL
.ltr &, .rtl.menu-inverted & {
right: 0;
}
}
- &[data-menu="audio"]{
+ &[data-menu="audio"] {
overflow: visible;
+
a, div {
&.button.back {
top: -30px;
li {
display: inline-block;
vertical-align: middle;
+
+ &:first-child {
+ a.icon-locales {
+ border: 0;
+ }
+ }
}
a {
}
}
- span{
+ span {
transition: color @page-transition-duration;
}