summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/lib
diff options
context:
space:
mode:
authorRegis <boudinot.regis@yahoo.com>2017-01-09 09:19:55 -0700
committerRegis <boudinot.regis@yahoo.com>2017-01-09 09:19:55 -0700
commit76c68d1a185009b831bab014446829158ced2f17 (patch)
tree1cbed4cb52dd0774f21cacba1ea4b2d6427bf12c /app/assets/javascripts/lib
parent3fff93ca01008e73c320ce87a686c69bada5dac3 (diff)
downloadgitlab-ce-76c68d1a185009b831bab014446829158ced2f17.tar.gz
namespace getParametersByName to gl.utils instead of just gl
Diffstat (limited to 'app/assets/javascripts/lib')
-rw-r--r--app/assets/javascripts/lib/utils/param_helper.js.es67
1 files changed, 5 insertions, 2 deletions
diff --git a/app/assets/javascripts/lib/utils/param_helper.js.es6 b/app/assets/javascripts/lib/utils/param_helper.js.es6
index 2b150c415c8..01b3a2ee07f 100644
--- a/app/assets/javascripts/lib/utils/param_helper.js.es6
+++ b/app/assets/javascripts/lib/utils/param_helper.js.es6
@@ -1,12 +1,15 @@
/* eslint-disable no-param-reassign */
-((w) => {
+((gl) => {
+ gl.utils = gl.utils || (gl.utils = {});
+
/**
this will take in the `name` of the param you want to parse in the url
if the name does not exist this function will return `null`
otherwise it will return the value of the param key provided
*/
- w.getParameterByName = (name) => {
+
+ gl.utils.getParameterByName = (name) => {
const url = window.location.href;
name = name.replace(/[[\]]/g, '\\$&');
const regex = new RegExp(`[?&]${name}(=([^&#]*)|&|#|$)`);