From 41f654569cdc098b0dda52f7e7d57acaef7a9d3d Mon Sep 17 00:00:00 2001 From: rolux Date: Fri, 12 Jul 2013 11:39:45 +0000 Subject: [PATCH] use user.ui._hash to store hash state --- static/js/pandora/URL.js | 15 +++++++++++++++ static/js/pandora/embedPlayer.js | 10 +++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/static/js/pandora/URL.js b/static/js/pandora/URL.js index 65769c01..4e6e3ce6 100644 --- a/static/js/pandora/URL.js +++ b/static/js/pandora/URL.js @@ -63,6 +63,20 @@ pandora.URL = (function() { } + if ( + pandora.user.ui._hash && ( + 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', 'GOT STATE ...', state) return state; @@ -86,6 +100,7 @@ pandora.URL = (function() { } else { + pandora.user.ui._hash = state.hash; if ( state.hash && !Ox.contains(['embed', 'print'], state.hash.anchor) diff --git a/static/js/pandora/embedPlayer.js b/static/js/pandora/embedPlayer.js index 53fc6227..8d8606c8 100644 --- a/static/js/pandora/embedPlayer.js +++ b/static/js/pandora/embedPlayer.js @@ -259,11 +259,11 @@ pandora.ui.embedPlayer = function() { function getOptions() { var options = {}; - ui.hash.query.forEach(function(condition) { - if (condition.key != 'embed') { - options[condition.key] = condition.value; - } - }); + if (ui._hash.query) { + ui._hash.query.forEach(function(condition) { + options[condition.key] = condition.value; + }); + } options = Ox.extend( {item: ui.item}, ui.videoPoints[ui.item] || {},