diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-22 18:09:01 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-22 18:09:01 +0000 |
commit | b3c281c8c7109b3286a505d29330926e59139009 (patch) | |
tree | ccad33a8106da31a7f1ad6ea71250e2a80719674 /app/assets/javascripts/sourcegraph | |
parent | 9ed2b33fff06f930bd7445b3316cbe9933c48ea0 (diff) | |
download | gitlab-ce-b3c281c8c7109b3286a505d29330926e59139009.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/sourcegraph')
-rw-r--r-- | app/assets/javascripts/sourcegraph/index.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/assets/javascripts/sourcegraph/index.js b/app/assets/javascripts/sourcegraph/index.js index 796e90bf08e..27b63a217d3 100644 --- a/app/assets/javascripts/sourcegraph/index.js +++ b/app/assets/javascripts/sourcegraph/index.js @@ -1,3 +1,5 @@ +import { joinPaths } from '~/lib/utils/url_utility'; + function loadScript(path) { const script = document.createElement('script'); script.type = 'application/javascript'; @@ -17,10 +19,11 @@ export default function initSourcegraph() { return; } - const assetsUrl = new URL('/assets/webpack/sourcegraph/', window.location.href); - const scriptPath = new URL('scripts/integration.bundle.js', assetsUrl).href; + const base = gon.asset_host || gon.gitlab_url; + const assetsUrl = joinPaths(base, '/assets/webpack/sourcegraph/'); + const scriptPath = joinPaths(assetsUrl, 'scripts/integration.bundle.js'); - window.SOURCEGRAPH_ASSETS_URL = assetsUrl.href; + window.SOURCEGRAPH_ASSETS_URL = assetsUrl; window.SOURCEGRAPH_URL = url; window.SOURCEGRAPH_INTEGRATION = 'gitlab-integration'; |