]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
remove origin from url to be able to redirect locally
authorMaxime Locqueville <maxiloc@gmail.com>
Mon, 29 May 2017 04:43:53 +0000 (06:43 +0200)
committerMark Otto <markd.otto@gmail.com>
Tue, 30 May 2017 06:32:28 +0000 (23:32 -0700)
_includes/footer.html

index 4747abf24494fc3e41989ba728ad3dab72d811c4..4b639ea21ae6c9647b33ac8245f5cf8f12d58377 100644 (file)
 <script src="{{ site.baseurl }}/assets/js/ie-emulation-modes-warning.js"></script>
 
 {% if page.layout == "docs" %}
-<script src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script>
-<script>
-  docsearch({
+<script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script>
+<script type="text/javascript">
+  var docsearch = docsearch({
     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", "")
+      }
+  });
 </script>
 {% endif %}