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:
authorFilipa Lacerda <filipa@gitlab.com>2017-02-16 14:29:45 +0300
committerFilipa Lacerda <filipa@gitlab.com>2017-02-16 14:29:45 +0300
commitba53ee78fa5ff5be573ca9f9e2dda75e8089aa85 (patch)
treef1985e7a39ea05c61a72268b077f3fefa7ff69b7 /app/assets/javascripts/lib
parent8ca90a68c4201714b01f88880a132d4febada48c (diff)
Changes after review
Diffstat (limited to 'app/assets/javascripts/lib')
-rw-r--r--app/assets/javascripts/lib/utils/common_utils.js.es612
1 files changed, 6 insertions, 6 deletions
diff --git a/app/assets/javascripts/lib/utils/common_utils.js.es6 b/app/assets/javascripts/lib/utils/common_utils.js.es6
index 276ff01ab89..9c010e49284 100644
--- a/app/assets/javascripts/lib/utils/common_utils.js.es6
+++ b/app/assets/javascripts/lib/utils/common_utils.js.es6
@@ -256,19 +256,19 @@
*/
w.gl.utils.setParamInURL = (param, value) => {
let search;
+ const locationSearch = window.location.search;
- if (window.location.search.length === 0) {
+ if (locationSearch.length === 0) {
search = `?${param}=${value}`;
}
- if (window.location.search.indexOf(param) !== -1) {
+ if (locationSearch.indexOf(param) !== -1) {
const regex = new RegExp(param + '=\\d');
- search = window.location.search.replace(regex, `${param}=${value}`);
+ search = locationSearch.replace(regex, `${param}=${value}`);
}
- if (window.location.search.length &&
- window.location.search.indexOf(param) === -1) {
- search = `${window.location.search}&${param}=${value}`;
+ if (locationSearch.length && locationSearch.indexOf(param) === -1) {
+ search = `${locationSearch}&${param}=${value}`;
}
return search;