From 89c306b59e39db45a3a8e09515f96c768efe82a7 Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 4 Mar 2013 10:09:42 +0000 Subject: [PATCH] update URL controller --- static/js/pandora/URL.js | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/static/js/pandora/URL.js b/static/js/pandora/URL.js index 498df374..1125a77a 100644 --- a/static/js/pandora/URL.js +++ b/static/js/pandora/URL.js @@ -58,9 +58,17 @@ pandora.URL = (function() { } - state.hash = pandora.user.ui.hash; + if (pandora.user.ui.hash.anchor || !Ox.isEmpty(pandora.user.ui.hash.query)) { + state.hash = {}; + if (pandora.user.ui.hash.anchor) { + state.hash.anchor = pandora.user.ui.hash.anchor; + } + if (!Ox.isEmpty(pandora.user.ui.hash.query)) { + state.hash.query = pandora.user.ui.hash.query; + } + } - Ox.Log('', 'URL', 'STATE ...', state) + Ox.Log('URL', 'GOT STATE ...', state) return state; @@ -87,6 +95,9 @@ pandora.URL = (function() { if (state.hash) { set.hash = state.hash; + if (!state.hash.anchor) { + state.hash.anchor = ''; + } if (state.hash.query) { if (state.hash.query.embed === true) { // ... @@ -95,9 +106,11 @@ pandora.URL = (function() { set[kv.key] = kv.value; }); } + } else { + set.hash.query = []; } } else { - set.hash = null; + set.hash = Ox.clone(pandora.site.user.ui.hash, true); } if (state.page) { @@ -296,9 +309,9 @@ pandora.URL = (function() { self.URL = Ox.URL({ findKeys: findKeys, - getHash: pandora.normalizeHashQuery, - getItem: pandora.getItemByIdOrTitle, - getSpan: pandora.getMetadataByIdOrName, + getHash: pandora.getHash, + getItem: pandora.getItem, + getSpan: pandora.getSpan, pages: [].concat( ['home', 'software', 'api', 'help', 'tv'], pandora.site.sitePages.map(function(page) {