From 2c58f8f15e614889a0313113b8fa9283b6bda89c Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 25 Feb 2013 13:44:13 +0530 Subject: [PATCH] move message handling from embedPanel.js to pandora.js --- static/js/pandora.js | 13 +++++++++++++ static/js/pandora/embedPanel.js | 13 +------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/static/js/pandora.js b/static/js/pandora.js index 8c81b54b..6ec75bcb 100644 --- a/static/js/pandora.js +++ b/static/js/pandora.js @@ -314,6 +314,19 @@ appPanel Ox.Theme(pandora.user.ui.theme); if (isEmbed) { pandora.$ui.embedPanel = pandora.ui.embedPanel().display(); + Ox.$parent.onMessage({ + settheme: function(data) { + if (Ox.contains(pandora.site.themes, data.theme)) { + Ox.Theme(data.theme); + } + }, + seturl: function(data) { + Ox.print('SET URL', data.url); + if (pandora.isEmbedURL(data.url)) { + pandora.URL.push(data.url); + } + } + }); } else { pandora.$ui.appPanel = pandora.ui.appPanel().display(); Ox.Request.requests() && pandora.$ui.loadingIcon.start(); diff --git a/static/js/pandora/embedPanel.js b/static/js/pandora/embedPanel.js index 7ab9421d..ce207baa 100644 --- a/static/js/pandora/embedPanel.js +++ b/static/js/pandora/embedPanel.js @@ -391,18 +391,7 @@ pandora.ui.embedPanel = function() { pandora_hash: that.reloadPanel }); - Ox.$parent.onMessage({ - settheme: function(data) { - if (Ox.contains(pandora.site.themes, data.theme)) { - Ox.Theme(data.theme); - } - }, - seturl: function(data) { - if (pandora.isEmbedURL(data.url)) { - pandora.URL.push(data.url); - } - } - }); + Ox.$parent.postMessage('loaded'); return that;