update URL controller

This commit is contained in:
rolux 2013-03-04 10:09:42 +00:00
parent 1392cdfaf1
commit 89c306b59e

View file

@ -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; return state;
@ -87,6 +95,9 @@ pandora.URL = (function() {
if (state.hash) { if (state.hash) {
set.hash = state.hash; set.hash = state.hash;
if (!state.hash.anchor) {
state.hash.anchor = '';
}
if (state.hash.query) { if (state.hash.query) {
if (state.hash.query.embed === true) { if (state.hash.query.embed === true) {
// ... // ...
@ -95,9 +106,11 @@ pandora.URL = (function() {
set[kv.key] = kv.value; set[kv.key] = kv.value;
}); });
} }
} else {
set.hash.query = [];
} }
} else { } else {
set.hash = null; set.hash = Ox.clone(pandora.site.user.ui.hash, true);
} }
if (state.page) { if (state.page) {
@ -296,9 +309,9 @@ pandora.URL = (function() {
self.URL = Ox.URL({ self.URL = Ox.URL({
findKeys: findKeys, findKeys: findKeys,
getHash: pandora.normalizeHashQuery, getHash: pandora.getHash,
getItem: pandora.getItemByIdOrTitle, getItem: pandora.getItem,
getSpan: pandora.getMetadataByIdOrName, getSpan: pandora.getSpan,
pages: [].concat( pages: [].concat(
['home', 'software', 'api', 'help', 'tv'], ['home', 'software', 'api', 'help', 'tv'],
pandora.site.sitePages.map(function(page) { pandora.site.sitePages.map(function(page) {