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
path: root/site
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@gmail.com>2019-03-26 13:49:45 +0300
committerGitHub <noreply@github.com>2019-03-26 13:49:45 +0300
commit6672aea5a9f8c21d9419757a782d414c3ac460e4 (patch)
tree5a7fa1e63157dd521d475d37714d1a4f2c37f91d /site
parentd7ecff24d10ae462f9c26a86174aaa28c95e6cae (diff)
Remove `http` from docs search. (#28557)
We use only `https` for a few months now.
Diffstat (limited to 'site')
-rw-r--r--site/static/docs/4.3/assets/js/src/search.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/site/static/docs/4.3/assets/js/src/search.js b/site/static/docs/4.3/assets/js/src/search.js
index dc222508d6..fcff6f6371 100644
--- a/site/static/docs/4.3/assets/js/src/search.js
+++ b/site/static/docs/4.3/assets/js/src/search.js
@@ -34,12 +34,15 @@
},
transformData: function (hits) {
return hits.map(function (hit) {
- var siteurl = getOrigin()
- var urlRE = /^https?:\/\/getbootstrap\.com/
+ var currentUrl = getOrigin()
+ var liveUrl = 'https://getbootstrap.com'
// When in production, return the result as is,
// otherwise remove our url from it.
- hit.url = siteurl.match(urlRE) ? hit.url : hit.url.replace(urlRE, '')
+ // eslint-disable-next-line no-negated-condition
+ hit.url = currentUrl.indexOf(liveUrl) !== -1 ?
+ hit.url :
+ hit.url.replace(liveUrl, '')
// Prevent jumping to first header
if (hit.anchor === 'content') {
@@ -50,6 +53,7 @@
return hit
})
},
- debug: false // Set debug to true if you want to inspect the dropdown
+ // Set debug to `true` if you want to inspect the dropdown
+ debug: false
})
})()