diff --git a/static/js/pandora/URL.js b/static/js/pandora/URL.js index 73af136d..7e805e9e 100644 --- a/static/js/pandora/URL.js +++ b/static/js/pandora/URL.js @@ -211,8 +211,15 @@ pandora.URL = (function() { Ox.print('EQUAL', pandora.user.ui.findQuery, oldUserUI.findQuery) pandora.$ui.contentPanel.replaceElement(1, pandora.ui.list()); } else { + if (pandora.isClipView()) { + pandora.UI.set('lists|' + pandora.user.ui.list + '|selected', []); + } pandora.$ui.leftPanel.replaceElement(2, pandora.$ui.info = pandora.ui.info()); - pandora.$ui.mainPanel.replaceElement(1, pandora.$ui.rightPanel = pandora.ui.rightPanel()); + if (pandora.user.ui.list == oldUserUI.list) { + pandora.$ui.contentPanel.replaceElement(1, pandora.$ui.list = pandora.ui.list()); + } else { + pandora.$ui.mainPanel.replaceElement(1, pandora.$ui.rightPanel = pandora.ui.rightPanel()); + } } // fixme: should list selection and deselection happen here? // (home and menu may cause a list switch) diff --git a/static/js/pandora/pandora.js b/static/js/pandora/pandora.js index f7f879c0..0b25b509 100644 --- a/static/js/pandora/pandora.js +++ b/static/js/pandora/pandora.js @@ -445,6 +445,7 @@ pandora.getVideoPartsAndPoints = function(durations, points) { }; pandora.isClipView = function(view) { + view = view || pandora.user.ui.lists[pandora.user.ui.list].listView; return ['calendar', 'clip', 'map'].indexOf(view) > -1; }; diff --git a/static/js/pandora/ui/info.js b/static/js/pandora/ui/info.js index e120e06d..59b591a9 100644 --- a/static/js/pandora/ui/info.js +++ b/static/js/pandora/ui/info.js @@ -1,7 +1,7 @@ // vim: et:ts=4:sw=4:sts=4:ft=javascript -pandora.ui.info = function(id) { +pandora.ui.info = function() { var list = pandora.user.ui.lists[pandora.user.ui.list], - id = id || pandora.user.ui.item || (list.selected.length ? list.selected[list.selected.length - 1] : null), + id = pandora.user.ui.item || (list.selected.length ? list.selected[list.selected.length - 1] : null), view = getView(), that = Ox.Element() .css({overflowX: 'hidden', overflowY: 'auto'}) @@ -11,6 +11,7 @@ pandora.ui.info = function(id) { pandora.resizeFolders(); } }); + Ox.print('INFO', view) if (view == 'list') { that.empty().append(pandora.$ui.listInfo = pandora.ui.listInfo(list)); } else if (view == 'poster') { @@ -36,7 +37,7 @@ pandora.ui.info = function(id) { pandora.$ui.leftPanel && resize(); function getView() { return !id ? 'list' - : !pandora.user.ui.item && pandora.isClipView(list.listView) ? 'poster' + : !pandora.user.ui.item && pandora.isClipView() ? 'poster' : 'video'; } function resize() { diff --git a/static/js/pandora/ui/list.js b/static/js/pandora/ui/list.js index 558c6df0..177e6ea9 100644 --- a/static/js/pandora/ui/list.js +++ b/static/js/pandora/ui/list.js @@ -292,8 +292,8 @@ pandora.ui.list = function() { // fixme: remove view argument item = id.split('/')[0], width, height, $img = $('.OxItem.OxSelected > .OxIcon > img'), $video = $('.OxItem.OxSelected > .OxIcon > .OxVideoPlayer'); - pandora.UI.set(['lists', pandora.user.ui.list, 'selected'].join('|'), item); - pandora.$ui.leftPanel.replaceElement(2, pandora.$ui.info = pandora.ui.info(data.ids[0].split('/')[0])); + pandora.UI.set('lists|' + pandora.user.ui.list + '|selected', [item]); + pandora.$ui.leftPanel.replaceElement(2, pandora.$ui.info = pandora.ui.info()); if ($img.length) { var width = parseInt($img.css('width')), height = parseInt($img.css('height')); @@ -333,6 +333,7 @@ pandora.ui.list = function() { // fixme: remove view argument }, 300); } } else { + pandora.UI.set('lists|' + pandora.user.ui.list + '|selected', []); pandora.$ui.leftPanel.replaceElement(2, pandora.$ui.info = pandora.ui.info()); $('.OxSelectedVideo').removeClass('OxSelectedVideo'); } diff --git a/static/js/pandora/ui/viewSelect.js b/static/js/pandora/ui/viewSelect.js index d0a65385..5c82b38d 100644 --- a/static/js/pandora/ui/viewSelect.js +++ b/static/js/pandora/ui/viewSelect.js @@ -23,15 +23,14 @@ pandora.ui.viewSelect = function() { change: !pandora.user.ui.item ? function(data) { var view = data.selected[0].id, isClipView = pandora.isClipView(view), - wasClipView = pandora.isClipView(pandora.user.ui.lists[pandora.user.ui.list].listView); - pandora.UI.set(['lists', pandora.user.ui.list, 'listView'].join('|'), view); + wasClipView = pandora.isClipView(); + pandora.UI.set('lists|' + pandora.user.ui.list + '|listView', view); pandora.$ui.mainMenu.checkItem('viewMenu_movies_' + view); if (isClipView != wasClipView) { pandora.$ui.mainMenu.replaceMenu('sortMenu', pandora.getSortMenu()); pandora.$ui.sortSelect.replaceWith(pandora.$ui.sortSelect = pandora.ui.sortSelect()); } - pandora.$ui.contentPanel.replaceElement(1, pandora.$ui.list = pandora.ui.list()); - pandora.URL.push('/' + view + '/' + document.location.search); + pandora.URL.set(view + '/' + document.location.search); // pandora.URL.set('/' + view + '/' + document.location.search); } : function(data) { var view = data.selected[0].id;