Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@gmail.com>2020-11-09 09:48:37 +0300
committerXhmikosR <xhmikosr@gmail.com>2020-11-14 16:54:50 +0300
commit12f510861bea74a9c865b5a87b27ce958ee38187 (patch)
treef8a8a9663d96ca24f9ba4a67085e9b7a65edb227 /site/assets
parenteaf616c6538847561cbfd60ce7fc54cea16d8a1b (diff)
search.js: remove `window.location.origin` workaround
Diffstat (limited to 'site/assets')
-rw-r--r--site/assets/js/search.js16
1 files changed, 1 insertions, 15 deletions
diff --git a/site/assets/js/search.js b/site/assets/js/search.js
index cce2bcd0d1..e198eddb32 100644
--- a/site/assets/js/search.js
+++ b/site/assets/js/search.js
@@ -20,19 +20,6 @@
}
})
- function getOrigin() {
- var location = window.location
- var origin = location.origin
-
- if (!origin) {
- var port = location.port ? ':' + location.port : ''
-
- origin = location.protocol + '//' + location.hostname + port
- }
-
- return origin
- }
-
window.docsearch({
apiKey: '5990ad008512000bba2cf951ccf0332f',
indexName: 'bootstrap',
@@ -42,10 +29,9 @@
},
transformData: function (hits) {
return hits.map(function (hit) {
- var currentUrl = getOrigin()
var liveUrl = 'https://v5.getbootstrap.com/'
- hit.url = currentUrl.startsWith(liveUrl) ?
+ 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,