0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-02-19 16:54:24 +01:00

remove origin from url to be able to redirect locally

This commit is contained in:
Maxime Locqueville 2017-05-29 06:43:53 +02:00 committed by Mark Otto
parent 3e76d65656
commit ab9a5f0256

View File

@ -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 %}