From c63677fd1fa27c6e6b93c7d2f96b2c927e7b6ae2 Mon Sep 17 00:00:00 2001 From: rolux Date: Sat, 8 Oct 2011 15:03:13 +0000 Subject: [PATCH] return to the correct url after closing the site dialog; don't cancel requests when opening the site dialog --- static/js/pandora/URL.js | 10 +++++----- static/js/pandora/ui/siteDialog.js | 4 +--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/static/js/pandora/URL.js b/static/js/pandora/URL.js index 3e40923e..e28cb817 100644 --- a/static/js/pandora/URL.js +++ b/static/js/pandora/URL.js @@ -100,11 +100,6 @@ pandora.URL = (function() { Ox.print('SET STATE:', state) var find, previousUI = pandora.UI.getPrevious(); - Ox.Request.cancel(); - $('video').each(function() { - $(this).trigger('stop'); - }); - pandora.user.ui._groupsState = pandora.getGroupsState(pandora.user.ui.find); pandora.user.ui._findState = pandora.getFindState(pandora.user.ui.find); @@ -207,6 +202,11 @@ pandora.URL = (function() { } //*/ + Ox.Request.cancel(); + $('video').each(function() { + $(this).trigger('stop'); + }); + if (!pandora.$ui.appPanel && state.item && pandora.user.ui.find) { // on page load, if item is set and there is or was a query, // we have to check if the item actually matches the query, diff --git a/static/js/pandora/ui/siteDialog.js b/static/js/pandora/ui/siteDialog.js index c14547ec..729fb3dc 100644 --- a/static/js/pandora/ui/siteDialog.js +++ b/static/js/pandora/ui/siteDialog.js @@ -62,9 +62,7 @@ pandora.ui.siteDialog = function(section) { }).bindEvent({ click: function() { $dialog.close(); - //fixme: this should be using URL.push / UI.set - //but that currenlty causes a reload - history.pushState({}, '', '/'); + pandora.URL.update(); } }) ],