]> _ Git - fluidbook-html5.git/commitdiff
Ensure menu works even if search feature is disabled. WIP #1499 @0.5
authorStephen Cameron <stephen@cubedesigners.com>
Mon, 10 Jul 2017 14:59:54 +0000 (16:59 +0200)
committerStephen Cameron <stephen@cubedesigners.com>
Mon, 10 Jul 2017 14:59:54 +0000 (16:59 +0200)
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.nav.js

index 7b46c347681e49ede9685816040c02354373a752..73a8a5cfcaaca1dc91e41251d80065374b0a8577 100644 (file)
@@ -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);
     },
 
index 90f6c2ac340409e0a6e66e62f21eae5dc3e8cda0..1b0d34a5f2b3603a63f12c4941aef7c9af358c4b 100644 (file)
@@ -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('<ul id="menuList"></ul>');
 
         // Add Search form
-        $('#menuList').prepend('<li id="menuSearch">' + this.getSearch() + '</li>');
+        if (this.fluidbook.datas.search) {
+            $('#menuList').prepend('<li id="menuSearch">' + this.getSearch() + '</li>');
+        }
 
         try {
             var skipHome = (window.localStorage.getItem('home') === '0');