diff --git a/static/js/pandora/URL.js b/static/js/pandora/URL.js index 1775a8c71..e90cf73ab 100644 --- a/static/js/pandora/URL.js +++ b/static/js/pandora/URL.js @@ -9,13 +9,17 @@ pandora.URL = (function() { if (/^\?url=/.test(search)) { document.location = decodeURIComponent(search.substr(5)); } else { - pandora.Query.fromString(search); - pandora.UI.set({ - section: 'items', - item: '' - }); if (!search && pandora.user.ui.showHome) { pandora.$ui.home = pandora.ui.home().showScreen(); + pandora.user.ui.list && pandora.Query.fromString( + 'find=list:' + pandora.user.ui.list + ); + } else { + pandora.Query.fromString(search); + pandora.UI.set({ + section: 'items', + item: '' + }); } } }, @@ -139,7 +143,6 @@ pandora.URL = (function() { + document.location.search + document.location.hash; */ - pandora.Query.updateGroups(); Ox.forEach(regexps, function(fn, re) { re = new RegExp(re); if (re.test(pathname)) { @@ -148,6 +151,7 @@ pandora.URL = (function() { return false; } }); + pandora.Query.updateGroups(); pandora.user.ui.showHome = false; }, diff --git a/static/js/pandora/ui/folderBrowserList.js b/static/js/pandora/ui/folderBrowserList.js index 4b0e5c39e..47caa4b0a 100644 --- a/static/js/pandora/ui/folderBrowserList.js +++ b/static/js/pandora/ui/folderBrowserList.js @@ -181,10 +181,10 @@ pandora.ui.folderBrowserList = function(id) { Ox.forEach(pandora.$ui.folderList, function($list, id_) { id != id_ && $list.options('selected', []); }); - pandora.UI.set({list: data.ids[0]}); + //pandora.UI.set({list: data.ids[0]}); pandora.URL.set('?find=list:' + data.ids[0]); } else { - pandora.UI.set({list: ''}); + //pandora.UI.set({list: ''}); pandora.URL.set(''); } } diff --git a/static/js/pandora/ui/foldersList.js b/static/js/pandora/ui/foldersList.js index 0156df50c..8a0cdfd5c 100644 --- a/static/js/pandora/ui/foldersList.js +++ b/static/js/pandora/ui/foldersList.js @@ -361,6 +361,7 @@ pandora.ui.folderList = function(id) { Ox.forEach(pandora.$ui.folderList, function($list, id_) { id != id_ && $list.options('selected', []); }); + //pandora.UI.set({list: data.ids[0]}); pandora.URL.set('?find=' + (id == 'volumes' ? 'volume' : 'list') + ':' + data.ids[0]); } else { //pandora.UI.set({list: ''}); diff --git a/static/js/pandora/ui/home.js b/static/js/pandora/ui/home.js index 6973cc0ce..61cb8eb6b 100644 --- a/static/js/pandora/ui/home.js +++ b/static/js/pandora/ui/home.js @@ -2,6 +2,8 @@ pandora.ui.home = function() { + // fixme: if a list was selected previously, it will steal focus from the input element + var that = $('
') .attr({id: 'home'}) .css({ @@ -85,8 +87,11 @@ pandora.ui.home = function() { }) .bindEvent({ submit: function(data) { - data.value && pandora.URL.set('/?find=' + data.value); - that.fadeOutScreen(); + if (data.value) { + $findButton.triggerEvent('click'); + } else { + $browseButton.triggerEvent('click'); + } } }) .appendTo(that), @@ -105,6 +110,11 @@ pandora.ui.home = function() { }) .bindEvent({ click: function() { + if (pandora.user.ui.list) { + Ox.forEach(pandora.$ui.folderList, function($list) { + $list.options({selected: []}); + }); + } pandora.URL.set('/?find=' + $findInput.value()); that.fadeOutScreen(); }