From cd911df05151cfe01a5af8f06529b62a1849a249 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 17 May 2013 11:48:18 +0000 Subject: [PATCH] dont call api.setUI if in embed or print view, otherwise ui.hash.query stays around --- static/js/pandora/UI.js | 2 +- static/js/pandora/utils.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/static/js/pandora/UI.js b/static/js/pandora/UI.js index e5b9bf8f..60ba1e67 100644 --- a/static/js/pandora/UI.js +++ b/static/js/pandora/UI.js @@ -182,7 +182,7 @@ pandora.UI = (function() { } }); }); - Ox.len(set) && pandora.api.setUI(set); + !pandora.isEmbedURL() && !pandora.isPrintURL() && Ox.len(set) && pandora.api.setUI(set); triggerEvents && Ox.forEach(trigger, function(val, key) { Ox.Log('UI', 'TRIGGER ' + key + ' ' + val); Ox.forEach(pandora.$ui, function(element) { diff --git a/static/js/pandora/utils.js b/static/js/pandora/utils.js index c1a61bcb..96586083 100644 --- a/static/js/pandora/utils.js +++ b/static/js/pandora/utils.js @@ -1193,6 +1193,13 @@ pandora.isEmbedURL = function(url) { && Ox.unserialize(hash.substr(2), true).embed === true }; +pandora.isPrintURL = function(url) { + url = url || document.location.href; + var hash = Ox.parseURL(url).hash; + return hash.substr(0, 2) == '#?' + && Ox.unserialize(hash.substr(2), true).print === true +}; + pandora.logEvent = function(data, event, element) { var element = this, handlers = self.eventHandlers ? self.eventHandlers[event] : [];