From da295687e5ffd293ab762f725af68fa07779d09b Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Thu, 15 Mar 2012 13:00:29 -0400 Subject: [PATCH] cpsing the web-world a little more so I can call event handler on-start and on-stop too --- web-world/js-impl.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/web-world/js-impl.js b/web-world/js-impl.js index 74ef879..b292af9 100644 --- a/web-world/js-impl.js +++ b/web-world/js-impl.js @@ -1209,11 +1209,12 @@ }); }; - startEventHandlers = function() { + startEventHandlers = function(k) { var i; for (i = 0; i < eventHandlers.length; i++) { startEventHandler(eventHandlers[i]); } + k(); }; stopEventHandlers = function() { @@ -1321,14 +1322,14 @@ for (i = 0; i < actions.length; i++) { actions[i](view); } + success(); } else { view.top = arrayTreeToDomNode(newMockView.getCursor().top().node); view.initialRender(top); eventHandlers = newMockView.eventHandlers.slice(0); view.eventHandlers = eventHandlers; - startEventHandlers(); + startEventHandlers(success); } - success(); }, function(err) { failure(err); @@ -1340,8 +1341,10 @@ startEventHandler : startEventHandler, stopEventHandler : stopEventHandler }; view.initialRender(top); - startEventHandlers(); - refreshView(function() {}, onMessyRestart); + startEventHandlers(function() { + refreshView(function() {}, onMessyRestart); + }); + }); };