post JSON messages, relay theme change to same-domain iframe
This commit is contained in:
parent
699f0b64a5
commit
ebdc2b7057
3 changed files with 28 additions and 13 deletions
|
|
@ -315,10 +315,15 @@ appPanel
|
|||
if (isEmbed) {
|
||||
pandora.$ui.embedPanel = pandora.ui.embedPanel().display();
|
||||
window.addEventListener('message', function(e) {
|
||||
var url = e.data;
|
||||
if (pandora.isEmbedURL(url)) {
|
||||
pandora.URL.push(url);
|
||||
}
|
||||
var data;
|
||||
try {
|
||||
data = JSON.parse(e.data);
|
||||
if (Ox.contains(pandora.site.themes, data.theme)) {
|
||||
Ox.Theme(data.theme);
|
||||
} else if (pandora.isEmbedURL(data.url)) {
|
||||
pandora.URL.push(data.url);
|
||||
}
|
||||
} catch() {}
|
||||
});
|
||||
} else {
|
||||
pandora.$ui.appPanel = pandora.ui.appPanel().display();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue