Fix some typos that made it not work in Firefox (not sure how it worked in Chrome)
This commit is contained in:
parent
0cd3278b8f
commit
5d0b9c875a
2 changed files with 6 additions and 6 deletions
app
|
@ -48,8 +48,8 @@ function receiveMessage(event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function create(dom) {
|
function create(dom) {
|
||||||
concreteDOM = deku.dom.create(event.data.dom);
|
virtualDOM = dom;
|
||||||
virtualDOM = event.data.dom;
|
concreteDOM = deku.dom.create(dom);
|
||||||
// TODO: target the actual HTML tag and combine our initial structure for styles/scripts/tags with theirs
|
// TODO: target the actual HTML tag and combine our initial structure for styles/scripts/tags with theirs
|
||||||
$('body').empty().append(concreteDOM);
|
$('body').empty().append(concreteDOM);
|
||||||
}
|
}
|
||||||
|
@ -57,9 +57,9 @@ function create(dom) {
|
||||||
function update(dom) {
|
function update(dom) {
|
||||||
function dispatch() {} // Might want to do something here in the future
|
function dispatch() {} // Might want to do something here in the future
|
||||||
var context = {}; // Might want to use this to send shared state to every component
|
var context = {}; // Might want to use this to send shared state to every component
|
||||||
var changes = deku.diff.diffNode(virtualDOM, event.data.dom);
|
var changes = deku.diff.diffNode(virtualDOM, dom);
|
||||||
changes.reduce(deku.dom.update(dispatch, context), concreteDOM); // Rerender
|
changes.reduce(deku.dom.update(dispatch, context), concreteDOM); // Rerender
|
||||||
virtualDOM = event.data.dom;
|
virtualDOM = dom;
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkGoals(goals, source, origin) {
|
function checkGoals(goals, source, origin) {
|
||||||
|
|
|
@ -48,8 +48,8 @@ module.exports = class WebSurfaceView extends CocoView
|
||||||
return elem.type
|
return elem.type
|
||||||
deku.element(elem.name, elem.attribs, (@dekuify(c) for c in elem.children ? []))
|
deku.element(elem.name, elem.attribs, (@dekuify(c) for c in elem.children ? []))
|
||||||
|
|
||||||
onIframeMessage: (e) =>
|
onIframeMessage: (event) =>
|
||||||
origin = e.origin or e.originalEvent.origin
|
origin = event.origin or event.originalEvent.origin
|
||||||
unless origin is window.location.origin
|
unless origin is window.location.origin
|
||||||
return console.log 'Ignoring message from bad origin:', origin
|
return console.log 'Ignoring message from bad origin:', origin
|
||||||
unless event.source is @iframe.contentWindow
|
unless event.source is @iframe.contentWindow
|
||||||
|
|
Reference in a new issue