From bd72abae6eba40a9d85163d8b7a92b15161bfee7 Mon Sep 17 00:00:00 2001 From: rolux Date: Sun, 9 Feb 2014 09:16:33 +0000 Subject: [PATCH] getSort: only return one sort object (otherwise, multiple comma-separated keys will appear in the URL) --- static/js/utils.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/static/js/utils.js b/static/js/utils.js index ba0fc3c90..0af936ff9 100644 --- a/static/js/utils.js +++ b/static/js/utils.js @@ -1529,8 +1529,9 @@ pandora.getSort = function(state, val, callback) { if (val[0].key == 'index') { pandora.api.getEdit({id: state.item}, function(result) { if (result.data.type == 'smart') { - state.sort = state.sort.slice(1); - if (state.sort.length == 0) { + if (state.sort.length > 1) { + state.sort = [state.sort[1]]; + } else { state.sort = [ pandora.site.user.ui.editSort.filter(function(sort) { return sort.key != 'index';