From 57227b9ff6e2d734693095050d8a02b74105d41f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 28 Nov 2013 15:48:28 +0100 Subject: [PATCH] Fix newly introduce bug in Callback#fire() --- src/core/Callback.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/Callback.js b/src/core/Callback.js index c1c9c4ab..2d2cf7ce 100644 --- a/src/core/Callback.js +++ b/src/core/Callback.js @@ -78,13 +78,14 @@ var Callback = { return false; var args = [].slice.call(arguments, 1), PaperScript = paper.PaperScript, - handleException = PaperScript && PaperScript.handleException; + handleException = PaperScript && PaperScript.handleException, + that = this; function callHandlers() { for (var i in handlers) { // When the handler function returns false, prevent the default // behaviour of the event by calling stop() on it. - if (handlers[i].apply(this, args) === false + if (handlers[i].apply(that, args) === false && event && event.stop) event.stop(); }