mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 05:53:39 -04:00
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) {
|
||||
concreteDOM = deku.dom.create(event.data.dom);
|
||||
virtualDOM = event.data.dom;
|
||||
virtualDOM = dom;
|
||||
concreteDOM = deku.dom.create(dom);
|
||||
// TODO: target the actual HTML tag and combine our initial structure for styles/scripts/tags with theirs
|
||||
$('body').empty().append(concreteDOM);
|
||||
}
|
||||
|
@ -57,9 +57,9 @@ function create(dom) {
|
|||
function update(dom) {
|
||||
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 changes = deku.diff.diffNode(virtualDOM, event.data.dom);
|
||||
var changes = deku.diff.diffNode(virtualDOM, dom);
|
||||
changes.reduce(deku.dom.update(dispatch, context), concreteDOM); // Rerender
|
||||
virtualDOM = event.data.dom;
|
||||
virtualDOM = dom;
|
||||
}
|
||||
|
||||
function checkGoals(goals, source, origin) {
|
||||
|
|
|
@ -48,8 +48,8 @@ module.exports = class WebSurfaceView extends CocoView
|
|||
return elem.type
|
||||
deku.element(elem.name, elem.attribs, (@dekuify(c) for c in elem.children ? []))
|
||||
|
||||
onIframeMessage: (e) =>
|
||||
origin = e.origin or e.originalEvent.origin
|
||||
onIframeMessage: (event) =>
|
||||
origin = event.origin or event.originalEvent.origin
|
||||
unless origin is window.location.origin
|
||||
return console.log 'Ignoring message from bad origin:', origin
|
||||
unless event.source is @iframe.contentWindow
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue