From: Stephen Cameron Date: Mon, 10 Jul 2017 14:59:54 +0000 (+0200) Subject: Ensure menu works even if search feature is disabled. WIP #1499 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=d0207cc3bcfe54d5f2833f37ab24b85d2dc5c021;p=fluidbook-html5.git Ensure menu works even if search feature is disabled. WIP #1499 @0.5 --- diff --git a/js/libs/fluidbook/fluidbook.js b/js/libs/fluidbook/fluidbook.js index 7b46c347..73a8a5cf 100644 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@ -814,6 +814,11 @@ Fluidbook.prototype = { // Check if a search is active in the interface isSearchActive: function () { + + if (!this.datas.search) { + return false; // Search feature disabled on this Fluidbook + } + return ($('#q').val().length > 0); }, diff --git a/js/libs/fluidbook/fluidbook.nav.js b/js/libs/fluidbook/fluidbook.nav.js index 90f6c2ac..1b0d34a5 100644 --- a/js/libs/fluidbook/fluidbook.nav.js +++ b/js/libs/fluidbook/fluidbook.nav.js @@ -104,9 +104,10 @@ FluidbookNav.prototype = { if (className != undefined) { res += ' class="' + className + '"'; } - if (help != undefined && help != '') { - res += ' data-tooltip="' + this.fluidbook.l10n.__(help) + '"'; - } + // ToDo: Allow tooltips for horizontal icon nav but not for menu version + // if (help != undefined && help != '') { + // res += ' data-tooltip="' + this.fluidbook.l10n.__(help) + '"'; + // } res += '>'; if (icon) { res += getSpriteIcon(name); @@ -147,7 +148,9 @@ FluidbookNav.prototype = { this.menu.append(''); // Add Search form - $('#menuList').prepend(''); + if (this.fluidbook.datas.search) { + $('#menuList').prepend(''); + } try { var skipHome = (window.localStorage.getItem('home') === '0');