]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Better handling of redirects
authorMaxime Locqueville <maxiloc@gmail.com>
Mon, 29 May 2017 06:34:03 +0000 (08:34 +0200)
committerMark Otto <markd.otto@gmail.com>
Tue, 30 May 2017 06:32:28 +0000 (23:32 -0700)
_includes/footer.html

index 4b639ea21ae6c9647b33ac8245f5cf8f12d58377..a2f74e0707adef7e0eff78e27169bf885e0728d3 100644 (file)
     apiKey: '48cb48b22351bc71ea5f12f4d1ede198',
     indexName: 'bootstrap-v4',
     inputSelector: '#search-input',
-    debug: true // Set debug to true if you want to inspect the dropdown
-  });
-
-  docsearch.autocomplete.on('autocomplete:selected', function(event, suggestion) {
-      location.href = suggestion.url.replace("https://v4-alpha.getbootstrap.com", "");
-  }).on('keypress', function(event) {
-      if (event.keyCode === 13) {
-          location.href = suggestion.url.replace("https://v4-alpha.getbootstrap.com", "")
-      }
+    transformData: function (hits) {
+      return hits.map(function (hit) {
+        hit.url = hit.url.replace('https://v4-alpha.getbootstrap.com', '');
+        return hit;
+      });
+    },
+    debug: false // Set debug to true if you want to inspect the dropdown
   });
 </script>
 {% endif %}