diff options
| author | Maxime Locqueville <[email protected]> | 2017-05-29 08:34:03 +0200 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2017-05-29 23:32:28 -0700 |
| commit | 5c704d77ca917c318fe500b4b6513089fe22fa53 (patch) | |
| tree | c2dfda8b4e1b9d985ad3094c53ba46c370b784e7 | |
| parent | ab9a5f0256d5b1f91b44f28448b9c96de6baa988 (diff) | |
| download | bootstrap-5c704d77ca917c318fe500b4b6513089fe22fa53.tar.xz bootstrap-5c704d77ca917c318fe500b4b6513089fe22fa53.zip | |
Better handling of redirects
| -rw-r--r-- | _includes/footer.html | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/_includes/footer.html b/_includes/footer.html index 4b639ea21..a2f74e070 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -42,15 +42,13 @@ 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 %} |
