diff --git a/lib/ace/RenderLoop.js b/lib/ace/RenderLoop.js index c1fcd490..9281bb00 100644 --- a/lib/ace/RenderLoop.js +++ b/lib/ace/RenderLoop.js @@ -5,8 +5,8 @@ * @license LGPLv3 * @author Fabian Jakobs */ -require.def("ace/RenderLoop", function() { - +require.def("ace/RenderLoop", ["ace/lib/event"], function(event) { + var RenderLoop = function(onRender) { this.onRender = onRender; this.pending = false; @@ -37,12 +37,12 @@ var RenderLoop = function(onRender) { this.setTimeoutZero = function(callback) { if (!this.attached) { var _self = this; - window.addEventListener("message", function(e) { + event.addListener(window, "message", function(e) { if (e.source == window && _self.callback && e.data == _self.messageName) { e.stopPropagation(); _self.callback(); } - }, false); + }); this.attached = true; } this.callback = callback;