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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Knox <simon@gitlab.com>2019-08-08 03:06:45 +0300
committerMike Greiling <mike@pixelcog.com>2019-08-08 03:06:45 +0300
commit055a7b973dd99185f2dee01a3d4774f9f0a5e1b6 (patch)
tree61c1032a084b9b996a9fa639bad263ea784b76c8 /app/assets/javascripts/lib/utils/url_utility.js
parenteec1ed522d4103ee7d347c305f1021db33173def (diff)
Simplify getTimeDiff function
Pass keyname instead of translated string
Diffstat (limited to 'app/assets/javascripts/lib/utils/url_utility.js')
-rw-r--r--app/assets/javascripts/lib/utils/url_utility.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/assets/javascripts/lib/utils/url_utility.js b/app/assets/javascripts/lib/utils/url_utility.js
index 32fd0990374..1336b6a5461 100644
--- a/app/assets/javascripts/lib/utils/url_utility.js
+++ b/app/assets/javascripts/lib/utils/url_utility.js
@@ -2,8 +2,8 @@ import { join as joinPaths } from 'path';
// Returns an array containing the value(s) of the
// of the key passed as an argument
-export function getParameterValues(sParam) {
- const sPageURL = decodeURIComponent(window.location.search.substring(1));
+export function getParameterValues(sParam, url = window.location) {
+ const sPageURL = decodeURIComponent(new URL(url).search.substring(1));
return sPageURL.split('&').reduce((acc, urlParam) => {
const sParameterName = urlParam.split('=');