Fix newly introduce bug in Callback#fire()

This commit is contained in:
Jürg Lehni 2013-11-28 15:48:28 +01:00
parent ed8de613c4
commit 57227b9ff6

View file

@ -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();
}