From 786321136a52723dc265372d9c7050bddc709f6a Mon Sep 17 00:00:00 2001 From: rolux Date: Sat, 17 Sep 2011 15:43:18 +0000 Subject: [PATCH] working around a bug where user.ui.lists is wrong on load (may be backend) --- static/js/pandora.js | 3 ++- static/js/pandora/Query.js | 4 +++- static/js/pandora/URL.js | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/static/js/pandora.js b/static/js/pandora.js index ff53100f..f73c2db1 100644 --- a/static/js/pandora.js +++ b/static/js/pandora.js @@ -86,7 +86,8 @@ Ox.load({ }); // fixme: this should not happen if (!pandora.user.ui.lists[pandora.user.ui.list]) { - pandora.user.ui.lists[pandora.user.ui.list] = pandora.user.ui.lists['']; + Ox.print('THIS SHOULD NOT HAPPEN', pandora.site.user.ui.lists['']) + pandora.user.ui.lists[pandora.user.ui.list] = pandora.site.user.ui.lists['']; } if (data.user.level == 'guest' && $.browser.mozilla) { diff --git a/static/js/pandora/Query.js b/static/js/pandora/Query.js index 30c050e6..0db63cb7 100644 --- a/static/js/pandora/Query.js +++ b/static/js/pandora/Query.js @@ -226,9 +226,11 @@ pandora.Query = (function() { Ox.print(Ox.repeat('-', 120)); Ox.print('STATE', data); Ox.print(Ox.repeat('-', 120)); + Ox.print('@@@@@', data.list, pandora.user.ui.lists[data.list]) !pandora.user.ui.lists[data.list] && pandora.UI.set( - 'lists|' + data.list, pandora.site.user.lists[''] + 'lists|' + data.list, pandora.site.user.ui.lists[''] ); + Ox.print('@@@@@', data.lists, pandora.user.ui.lists[data.list]) pandora.UI.set({list: data.list}); pandora.user.ui.find = data.find; pandora.user.ui.groupsData = data.groups; diff --git a/static/js/pandora/URL.js b/static/js/pandora/URL.js index e90cf73a..35f39f46 100644 --- a/static/js/pandora/URL.js +++ b/static/js/pandora/URL.js @@ -11,6 +11,7 @@ pandora.URL = (function() { } else { if (!search && pandora.user.ui.showHome) { pandora.$ui.home = pandora.ui.home().showScreen(); + Ox.print('LIST', pandora.user.ui.list) pandora.user.ui.list && pandora.Query.fromString( 'find=list:' + pandora.user.ui.list ); @@ -54,7 +55,7 @@ pandora.URL = (function() { section: 'items', item: '' }); - pandora.UI.set(['lists', pandora.user.ui.list, 'listView'].join('|'), pathname); + pandora.UI.set('lists|' + pandora.user.ui.list + '|listView', pathname); pandora.Query.fromString(search); }, '^[0-9A-Z]': function(pathname, search) {