mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Support more than one argument in Callback#fire().
This commit is contained in:
parent
32eb10b43b
commit
c4a66cff0a
1 changed files with 2 additions and 1 deletions
|
@ -72,11 +72,12 @@ var Callback = {
|
||||||
var handlers = this._handlers && this._handlers[type];
|
var handlers = this._handlers && this._handlers[type];
|
||||||
if (!handlers)
|
if (!handlers)
|
||||||
return false;
|
return false;
|
||||||
|
var args = [].slice.call(arguments, 1);
|
||||||
Base.each(handlers, function(func) {
|
Base.each(handlers, function(func) {
|
||||||
// When the handler function returns false, prevent the default
|
// When the handler function returns false, prevent the default
|
||||||
// behaviour of the event by calling stop() on it
|
// behaviour of the event by calling stop() on it
|
||||||
// PORT: Add to Sg
|
// PORT: Add to Sg
|
||||||
if (func.call(this, event) === false && event && event.stop)
|
if (func.apply(this, args) === false && event && event.stop)
|
||||||
event.stop();
|
event.stop();
|
||||||
}, this);
|
}, this);
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue