From: Vincent Vanwaelscappel Date: Mon, 18 Dec 2017 17:47:58 +0000 (+0100) Subject: #1762 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=00c828329ae1cb6794b16c50629bdbed79cca581;p=fluidbook-html5.git #1762 --- diff --git a/js/libs/fluidbook/fluidbook.nav.js b/js/libs/fluidbook/fluidbook.nav.js index c342874f..01883c45 100644 --- a/js/libs/fluidbook/fluidbook.nav.js +++ b/js/libs/fluidbook/fluidbook.nav.js @@ -31,7 +31,7 @@ FluidbookNav.prototype = { } return true; }, - preventDefault:function(){ + preventDefault: function () { return false; }, }, @@ -297,6 +297,11 @@ FluidbookNav.prototype = { "3d", "help", "lang", + "extra1", + "extra2", + "extra3", + "extra4", + "extra5", ]; // Fallback to default list if navOrder is still empty for some reason @@ -310,19 +315,6 @@ FluidbookNav.prototype = { navOrder.push(navOrder.splice(localeIconIndex, 1)[0]); // Push to end of array } - - // // Backwards compatibility for old "afterSearch" setting to work with new "extra" link - // if (this.fluidbook.datas.afterSearch != '' && this.fluidbook.datas.afterSearchLink != '' && this.fluidbook.datas.themeEnableAfterSearch) { - // - // // Only override "extra" link values if they're not already set - // if (this.fluidbook.datas.navExtraImage == '' && this.fluidbook.datas.navExtraLink == '') { - // this.fluidbook.datas.navExtraImage = this.fluidbook.datas.afterSearch; - // this.fluidbook.datas.navExtraLink = this.fluidbook.datas.afterSearchLink; - // this.fluidbook.datas.navExtraTooltip = this.fluidbook.datas.afterSearchTooltip; - // } - // } - - for (var i in navOrder) { var icon = navOrder[i]; //var visible = hide.indexOf(icon) == -1; @@ -455,10 +447,9 @@ FluidbookNav.prototype = { navExtraImage = this.fluidbook.datas.navExtraImage; link = ''; - } else if (this.fluidbook.datas.afterSearch != '' && this.fluidbook.datas.themeEnableAfterSearch && navType == 'horizontalNav') { - + } else if (this.fluidbook.datas.afterSearch != '' && this.fluidbook.datas.afterSearchDisplayForHTML && this.fluidbook.datas.themeEnableAfterSearch && navType == 'horizontalNav') { // Use the "afterSearch" image and links set in the theme and link editor - $nav.find('ul').append('
  • ' + this.fluidbook.loader.getImage('data/images/' + this.fluidbook.datas.afterSearch) + '
  • '); + $nav.find('ul').append('
  • ' + this.fluidbook.loader.getImage('data/images/' + this.fluidbook.datas.afterSearch) + '
  • '); } @@ -470,12 +461,54 @@ FluidbookNav.prototype = { if (link !== null) { $nav.find('ul').append('
  • ' + link + '
  • '); } + } else if (icon.match(/extra\d/)) { + var n = icon.substr(5, 1); + var extraURL = DATAS['navExtraLink' + n]; + var extraIcon = DATAS['navExtraIcon' + n]; + var extraVisibility = DATAS['navExtraVisibility' + n]; + if (extraURL == '' || extraIcon == '') { + continue; + } + if ((extraVisibility == 'horizontal' && navType == 'menu') || (extraVisibility == 'burger' && navType == 'horizontalNav')) { + continue; + } + var linkIcon; + if (extraIcon.indexOf('.') === -1) { + linkIcon = getSpriteIcon(extraIcon); + } else { + linkIcon = ''; + } + + if (extraURL.indexOf('link:') === 0) { + var linkId = extraURL.split(':', 2)[1]; + var foundLink; + $.each(DATAS.links, function (page, links) { + var l = $('' + links + '').find('[data-id="' + linkId + '"]'); + if (l.length == 1) { + foundLink = l; + return false; + } + }); + if (foundLink == undefined) { + continue; + } + link = $(foundLink).find('a').append(linkIcon); + if (navType == 'menu') { + var tooltip = $(link).data('tooltip'); + $(link).append('' + $(link).data('tooltip') + ''); + } + link = $(link).get(0).outerHTML; + } + + + var nav = this.getNavFromType(navType); + nav.find('ul').append('
  • ' + link + '
  • '); } // if (!visible) { // $(link).addClass('hidden'); // } - }; + } if (navType == 'menu') { diff --git a/js/libs/fluidbook/fluidbook.resize.js b/js/libs/fluidbook/fluidbook.resize.js index 30d31364..e85967e3 100644 --- a/js/libs/fluidbook/fluidbook.resize.js +++ b/js/libs/fluidbook/fluidbook.resize.js @@ -78,6 +78,8 @@ FluidbookResize.prototype = { this.updateWindow(); } + var headerScale = 1; + var interfaceScale, headerScale; if (this.orientation == 'landscape') { interfaceScale = Math.min(1, this.ww / this.referenceWidthLandscape, this.hh / this.referenceHeight);