Fix for back button (bug 812148)

We were erroneously appending a question mark when there were query
params in the original URL but not in the whitelisted object.
This commit is contained in:
Matt Basta 2012-11-15 10:40:28 -08:00
Родитель d3aa802db8
Коммит 2483378b36
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -1,4 +1,3 @@
var nav = (function() {
var stack = [
{
@ -25,6 +24,11 @@ var nav = (function() {
}
var used_params = _.pick(z.getVars(url_parts[1]), param_whitelist);
// If there are no query params after we filter, just return the path.
if (!_.keys(used_params).length) { // If there are no elements in the object...
return url_parts[0]; // ...just return the path.
}
var param_pairs = _.sortBy(_.pairs(used_params), function(x) {return x[0];});
return url_parts[0] + '?' + _.map(
param_pairs,