From f3b4308cb59bf4b21ff186f8479c82239446d139 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 7 Jun 2021 12:56:27 +0200 Subject: upgrade to bootstrap 5.0.1 and first batch of fixes --- vendor/twbs/bootstrap/site/assets/js/search.js | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'vendor/twbs/bootstrap/site/assets/js/search.js') diff --git a/vendor/twbs/bootstrap/site/assets/js/search.js b/vendor/twbs/bootstrap/site/assets/js/search.js index 724c6aa33..d88263d3f 100644 --- a/vendor/twbs/bootstrap/site/assets/js/search.js +++ b/vendor/twbs/bootstrap/site/assets/js/search.js @@ -11,20 +11,14 @@ return } - var siteDocsVersion = inputElement.getAttribute('data-docs-version') + var siteDocsVersion = inputElement.getAttribute('data-bd-docs-version') - function getOrigin() { - var location = window.location - var origin = location.origin - - if (!origin) { - var port = location.port ? ':' + location.port : '' - - origin = location.protocol + '//' + location.hostname + port + document.addEventListener('keydown', function (event) { + if (event.ctrlKey && event.key === '/') { + event.preventDefault() + inputElement.focus() } - - return origin - } + }) window.docsearch({ apiKey: '5990ad008512000bba2cf951ccf0332f', @@ -35,10 +29,9 @@ }, transformData: function (hits) { return hits.map(function (hit) { - var currentUrl = getOrigin() var liveUrl = 'https://getbootstrap.com/' - hit.url = currentUrl.lastIndexOf(liveUrl, 0) === 0 ? + hit.url = window.location.origin.startsWith(liveUrl) ? // On production, return the result as is hit.url : // On development or Netlify, replace `hit.url` with a trailing slash, -- cgit v1.2.3