From 2e3aa03c6bdf65ff868e36a6ffd135a9a76c194f Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 20 Feb 2013 10:52:37 +0530 Subject: [PATCH] fix a bug in normalizeHashQuery --- static/js/pandora/embedPanel.js | 3 +++ static/js/pandora/utils.js | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/static/js/pandora/embedPanel.js b/static/js/pandora/embedPanel.js index 1fe08925..d19a4ce9 100644 --- a/static/js/pandora/embedPanel.js +++ b/static/js/pandora/embedPanel.js @@ -17,6 +17,7 @@ pandora.ui.embedPanel = function() { right: 0, bottom: 0, }); + $errorBox = $('
') .css({ position: 'absolute', @@ -30,6 +31,7 @@ pandora.ui.embedPanel = function() { margin: 'auto' }) .appendTo(that); + $errorLogo = $('') .css({width: '96px', opacity: 0}) .one({ @@ -39,6 +41,7 @@ pandora.ui.embedPanel = function() { }) .attr({src: '/static/png/logo.png'}) .appendTo($errorBox); + $errorText = $('
') .css({marginTop: '4px', fontSize: '9px', textAlign: 'center'}) .html('This view cannot
be embedded.') diff --git a/static/js/pandora/utils.js b/static/js/pandora/utils.js index 5cc6b0e8..587fe458 100644 --- a/static/js/pandora/utils.js +++ b/static/js/pandora/utils.js @@ -1057,9 +1057,10 @@ pandora.normalizeHashQuery = function(state) { 'showAnnotations', 'showCloseButton', 'showLayers', 'showTimeline', 'title', 'width' ], - isEmbed = Ox.indexOf(state.hash.query, function(condition) { - return Ox.isEqual(condition, {key: 'embed', value: true}); - }) > -1, + isEmbed = state.hash && state.hash.query + && Ox.indexOf(state.hash.query, function(condition) { + return Ox.isEqual(condition, {key: 'embed', value: true}); + }) > -1, newState = Ox.clone(state, true), removeKeys = []; if (state.hash && state.hash.anchor) {