From bd4b7e5e9be64050fb91040de5776d2e8150e622 Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Fri, 22 Jul 2011 02:17:33 -0400 Subject: [PATCH] fixing bug with not deeply triggering the afterAttach event --- js-assembler/runtime-src/baselib-ports.js | 4 ++-- world/kernel.js | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/js-assembler/runtime-src/baselib-ports.js b/js-assembler/runtime-src/baselib-ports.js index cbf98f4..f590cb2 100644 --- a/js-assembler/runtime-src/baselib-ports.js +++ b/js-assembler/runtime-src/baselib-ports.js @@ -16,7 +16,7 @@ StandardOutputPort.prototype = baselib.heir(OutputPort.prototype); StandardOutputPort.prototype.writeDomNode = function(MACHINE, domNode) { MACHINE.params['currentDisplayer'](MACHINE, domNode); - jQuery(domNode).trigger({type : 'afterAttach'}); + jQuery('*', domNode).trigger({type : 'afterAttach'}); }; var StandardErrorPort = function() { @@ -25,7 +25,7 @@ StandardErrorPort.prototype = baselib.heir(OutputPort.prototype); StandardErrorPort.prototype.writeDomNode = function(MACHINE, domNode) { MACHINE.params['currentErrorDisplayer'](MACHINE, domNode); - jQuery(domNode).trigger({type : 'afterAttach'}); + jQuery('*', domNode).trigger({type : 'afterAttach'}); }; diff --git a/world/kernel.js b/world/kernel.js index a9421ed..18683af 100644 --- a/world/kernel.js +++ b/world/kernel.js @@ -27,8 +27,9 @@ var bigBang = function(MACHINE, initW, handlers) { var oldArgcount = MACHINE.argcount; - var toplevelNode = $('').get(0); - MACHINE.params.currentOutputPort.writeDomNode(MACHINE, toplevelNode); + var outerToplevelNode = $('').get(0); + MACHINE.params.currentOutputPort.writeDomNode(MACHINE, outerToplevelNode); + var toplevelNode = $('').appendTo(outerToplevelNode).get(0); var configs = []; var isOutputConfigSeen = false;