diff options
author | Regis <boudinot.regis@yahoo.com> | 2017-01-09 09:19:55 -0700 |
---|---|---|
committer | Regis <boudinot.regis@yahoo.com> | 2017-01-09 09:19:55 -0700 |
commit | 76c68d1a185009b831bab014446829158ced2f17 (patch) | |
tree | 1cbed4cb52dd0774f21cacba1ea4b2d6427bf12c /app/assets/javascripts/lib | |
parent | 3fff93ca01008e73c320ce87a686c69bada5dac3 (diff) | |
download | gitlab-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.es6 | 7 |
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}(=([^&#]*)|&|#|$)`); |