Refactor getUrlParamsArray()
This commit is contained in:
parent
bcb00bdc48
commit
49231ccef2
|
@ -80,9 +80,7 @@
|
|||
}
|
||||
|
||||
loadSearchParamsFromURL() {
|
||||
// We can trust that each param has one & since values containing & will be encoded
|
||||
// Remove the first character of search as it is always ?
|
||||
const params = window.location.search.slice(1).split('&');
|
||||
const params = gl.utils.getUrlParamsArray();
|
||||
let inputValues = [];
|
||||
|
||||
params.forEach((p) => {
|
||||
|
|
|
@ -124,6 +124,12 @@
|
|||
return parsedUrl.pathname.charAt(0) === '/' ? parsedUrl.pathname : '/' + parsedUrl.pathname;
|
||||
};
|
||||
|
||||
gl.utils.getUrlParamsArray = function () {
|
||||
// We can trust that each param has one & since values containing & will be encoded
|
||||
// Remove the first character of search as it is always ?
|
||||
return window.location.search.slice(1).split('&');
|
||||
}
|
||||
|
||||
gl.utils.getParameterByName = function(name) {
|
||||
var url = window.location.href;
|
||||
var param = name.replace(/[[\]]/g, '\\$&');
|
||||
|
|
Loading…
Reference in New Issue