fixing regression for #2355, introduced in a129075

This commit is contained in:
Julian Lam
2014-11-12 10:58:46 -05:00
parent c2467de9c2
commit 7e35987e1b
3 changed files with 30 additions and 3 deletions

View File

@@ -305,6 +305,24 @@
return a;
},
getQueryParams: function() {
var search = window.location.search.slice(1),
data = {};
search = search.split('&');
for(var x=0,numParams=search.length,temp;x<numParams;x++) {
temp = search[x].split('=');
if (temp[0].substr(-2, 2) !== '[]') {
data[temp[0]] = temp[1];
} else {
data[temp[0].slice(0, -2)] = data[temp[0].slice(0, -2)] || [];
data[temp[0].slice(0, -2)].push(temp[1]);
}
}
return data;
},
// return boolean if string 'true' or string 'false', or if a parsable string which is a number
// also supports JSON object and/or arrays parsing
toType: function(str) {