From 86881202b2fa5e17742dc5f318623fab27c0a022 Mon Sep 17 00:00:00 2001 From: rolux Date: Thu, 11 Jul 2013 18:11:07 +0000 Subject: [PATCH] URL controller: handle part --- static/js/pandora/URL.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/static/js/pandora/URL.js b/static/js/pandora/URL.js index d36bebb0..d7f955ec 100644 --- a/static/js/pandora/URL.js +++ b/static/js/pandora/URL.js @@ -16,6 +16,9 @@ pandora.URL = (function() { if (pandora.user.ui.page) { state.page = pandora.user.ui.page; + if (Ox.contains(Object.keys(pandora.site.user.ui.part), state.page)) { + state.part = pandora.user.ui.part[state.page]; + } } else { @@ -122,8 +125,8 @@ pandora.URL = (function() { if (state.page) { set.page = state.page; - if (state.page == 'help') { - set.help = state.hash ? state.hash.anchor : ''; + if (Ox.contains(Object.keys(pandora.site.user.ui.part), state.page) && state.part) { + set['part.' + state.page] = state.part; } pandora.UI.set(set); callback && callback(); @@ -336,6 +339,7 @@ pandora.URL = (function() { findKeys: findKeys, getHash: pandora.getHash, getItem: pandora.getItem, + getPart: pandora.getPart, getSpan: pandora.getSpan, pages: [].concat( ['home', 'software', 'api', 'help', 'tv'],