aboutsummaryrefslogtreecommitdiff
path: root/_includes
diff options
context:
space:
mode:
authorMaxime Locqueville <[email protected]>2017-05-29 06:43:53 +0200
committerMark Otto <[email protected]>2017-05-29 23:32:28 -0700
commitab9a5f0256d5b1f91b44f28448b9c96de6baa988 (patch)
treebff9307560d6ab949c0a4bfede509dbace5471fb /_includes
parent3e76d6565603fafa2c85ad81d7b6345c4e279c72 (diff)
downloadbootstrap-ab9a5f0256d5b1f91b44f28448b9c96de6baa988.tar.xz
bootstrap-ab9a5f0256d5b1f91b44f28448b9c96de6baa988.zip
remove origin from url to be able to redirect locally
Diffstat (limited to '_includes')
-rw-r--r--_includes/footer.html14
1 files changed, 11 insertions, 3 deletions
diff --git a/_includes/footer.html b/_includes/footer.html
index 4747abf24..4b639ea21 100644
--- a/_includes/footer.html
+++ b/_includes/footer.html
@@ -36,14 +36,22 @@
<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 %}