From 39b7f6b08fb77a7e4229d48efa23c9c8bf6ec170 Mon Sep 17 00:00:00 2001 From: rolux Date: Sat, 8 Oct 2011 18:36:26 +0000 Subject: [PATCH] reload map when changing group selection --- static/js/pandora/URL.js | 5 +++++ static/js/pandora/ui/mainPanel.js | 8 +++++++- static/js/pandora/ui/navigationView.js | 3 ++- static/js/pandora/ui/preferencesDialog.js | 1 + 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/static/js/pandora/URL.js b/static/js/pandora/URL.js index 1eb52680..6a415277 100644 --- a/static/js/pandora/URL.js +++ b/static/js/pandora/URL.js @@ -17,6 +17,9 @@ pandora.URL = (function() { state.type = pandora.site.itemsSection; if (!keys || keys.indexOf('item') > -1) { state.item = pandora.user.ui.item; + if (pandora.user.ui.item) { + state.view = pandora.user.ui.itemView; + } } if (!keys || keys.indexOf('listView') > -1 || keys.indexOf('itemView') > -1) { if (!pandora.user.ui.item) { @@ -33,12 +36,14 @@ pandora.URL = (function() { state.view = 'map'; state.span = pandora.user.ui.mapSelection ? '@' + pandora.user.ui.mapSelection : ''; + state.sort = pandora.user.ui.sort; } 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; } if (!keys || keys.filter(function(key) { return /^videoPoints/.test(key); diff --git a/static/js/pandora/ui/mainPanel.js b/static/js/pandora/ui/mainPanel.js index f0f745fe..b63e8568 100644 --- a/static/js/pandora/ui/mainPanel.js +++ b/static/js/pandora/ui/mainPanel.js @@ -21,7 +21,13 @@ pandora.ui.mainPanel = function() { pandora_find: function() { var previousUI = pandora.UI.getPrevious(); if (pandora.user.ui._list == previousUI._list) { - pandora.$ui.list.reloadList(); + if (['map', 'calendar'].indexOf(pandora.user.ui.listView) > -1) { + pandora.$ui.contentPanel.replaceElement(1, + pandora.ui.navigationView(pandora.user.ui.listView) + ); + } else { + pandora.$ui.list.reloadList(); + } pandora.user.ui._groupsState.forEach(function(data, i) { if (!Ox.isEqual(data.selected, previousUI._groupsState[i].selected)) { pandora.$ui.groups[i].options({selected: data.selected}); diff --git a/static/js/pandora/ui/navigationView.js b/static/js/pandora/ui/navigationView.js index de4e317b..a7660838 100644 --- a/static/js/pandora/ui/navigationView.js +++ b/static/js/pandora/ui/navigationView.js @@ -242,15 +242,16 @@ pandora.ui.navigationView = function(type, videoRatio) { }, data), callback); } }); + type == 'map' && pandora.UI.set({mapSelection: data.name}); } else { $list.options({ items: function(data, callback) { callback({data: {items: data.keys ? [] : 0}}); } }); + type == 'map' && pandora.UI.set({mapSelection: id ? $element.options('find') : ''}); } Ox.print('MAP SELECTION', id, data) - pandora.UI.set({mapSelection: id ? data.name : ''}); } function updateStatusbar(items) { diff --git a/static/js/pandora/ui/preferencesDialog.js b/static/js/pandora/ui/preferencesDialog.js index bdc6e728..825745d5 100644 --- a/static/js/pandora/ui/preferencesDialog.js +++ b/static/js/pandora/ui/preferencesDialog.js @@ -65,6 +65,7 @@ pandora.ui.preferencesDialog = function() { }).bindEvent({ click: function() { $dialog.close(); + pandora.URL.update(); } }) ],