mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Do not use Base.each() loops where it's not necessary.
This commit is contained in:
parent
18db7c0d56
commit
e87bf817de
1 changed files with 4 additions and 4 deletions
|
@ -77,12 +77,12 @@ var Callback = {
|
||||||
if (!handlers)
|
if (!handlers)
|
||||||
return false;
|
return false;
|
||||||
var args = [].slice.call(arguments, 1);
|
var args = [].slice.call(arguments, 1);
|
||||||
Base.each(handlers, function(func) {
|
for (var i in handlers) {
|
||||||
// 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.
|
||||||
if (func.apply(this, args) === false && event && event.stop)
|
if (handlers[i].apply(this, args) === false && event && event.stop)
|
||||||
event.stop();
|
event.stop();
|
||||||
}, this);
|
}
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue