From 106b2a557791dd9f5ebbe4b7d43c677e5a24df0c Mon Sep 17 00:00:00 2001 From: rolux Date: Sun, 9 Oct 2011 10:20:36 +0000 Subject: [PATCH 1/2] fix for '/@foo' urls --- static/js/pandora/URL.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/static/js/pandora/URL.js b/static/js/pandora/URL.js index 85483443..a1e5b6af 100644 --- a/static/js/pandora/URL.js +++ b/static/js/pandora/URL.js @@ -36,14 +36,16 @@ pandora.URL = (function() { state.view = 'map'; state.span = pandora.user.ui.mapSelection ? '@' + pandora.user.ui.mapSelection : ''; - state.sort = pandora.user.ui.sort; + state.sort = !pandora.user.ui.item + ? pandora.user.ui.listSort : pandora.user.ui.itemSort; } if (!keys || keys.indexOf('mapFind') > -1) { state.item = pandora.user.ui.item; state.view = 'map'; state.span = pandora.user.ui.mapFind ? '@' + pandora.user.ui.mapFind : ''; - state.sort = pandora.user.ui.sort; + state.sort = !pandora.user.ui.item + ? pandora.user.ui.listSort : pandora.user.ui.itemSort; } if (!keys || keys.filter(function(key) { return /^videoPoints/.test(key); @@ -77,6 +79,11 @@ pandora.URL = (function() { state.view = pandora.user.ui.itemView; state.sort = pandora.user.ui.itemSort; } + if (pandora.user.ui.mapSelection) { + state.span = '@' + pandora.user.ui.mapSelection; + } else if (pandora.user.ui.mapFind) { + state.span = '@' + pandora.user.ui.mapFind; + } /* : pandora.isClipView(pandora.user.ui.itemView) ? pandora.user.ui.itemSort : [], From 5d2821534f5766668e91cc4d14b06cdab76c5baa Mon Sep 17 00:00:00 2001 From: rolux Date: Sun, 9 Oct 2011 10:35:09 +0000 Subject: [PATCH 2/2] fix for sort operators --- static/js/pandora/ui/sortSelect.js | 6 +++++- static/js/pandora/utils.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/static/js/pandora/ui/sortSelect.js b/static/js/pandora/ui/sortSelect.js index bd1045fa..ac7f7060 100644 --- a/static/js/pandora/ui/sortSelect.js +++ b/static/js/pandora/ui/sortSelect.js @@ -31,7 +31,11 @@ pandora.ui.sortSelect = function() { }) .bindEvent({ change: function(data) { - pandora.UI.set(sortKey, [{key: data.selected[0].id, operator: ''}]); + var key = data.selected[0].id; + pandora.UI.set(sortKey, [{ + key: key, + operator: pandora.getSortOperator(key) + }]); }, pandora_listsort: function(data) { that.selectItem(data.value[0].key); diff --git a/static/js/pandora/utils.js b/static/js/pandora/utils.js index ad825980..bf186cc6 100644 --- a/static/js/pandora/utils.js +++ b/static/js/pandora/utils.js @@ -598,7 +598,7 @@ pandora._getSortOperator = function(type) { ) > -1 ? '+' : '-'; } -pandora.getSortOperator = function(key) { // fixme: remove +pandora.getSortOperator = function(key) { // fixme: remove? var type = Ox.getObjectById( /^clip:/.test(key) ? pandora.site.clipKeys : pandora.site.itemKeys, key