sync sort menu and text list

This commit is contained in:
rlx 2011-08-18 07:54:46 +00:00
commit fe8e821095
6 changed files with 91 additions and 60 deletions

View file

@ -106,9 +106,9 @@ pandora.Query = (function() {
}
if ('sort' in query) {
sort = query.sort.split(',');
pandora.UI.set(['lists', pandora.user.ui.list, 'sort'].join('|'), $.map(query.sort.split(','), function(v, i) {
pandora.UI.set(['lists', pandora.user.ui.list, 'sort'].join('|'), query.sort.split(',').map(function(v) {
var hasOperator = '+-'.indexOf(v[0]) > -1,
key = hasOperator ? query.sort.substr(1) : query.sort,
key = hasOperator ? v.substr(1) : v,
operator = hasOperator ? v[0]/*.replace('+', '')*/ : pandora.getSortOperator(key);
return {
key: key,