Do not use Base.each() loops where it's not necessary.

This commit is contained in:
Jürg Lehni 2013-11-27 16:02:24 +01:00
parent 18db7c0d56
commit e87bf817de

View file

@ -77,12 +77,12 @@ var Callback = {
if (!handlers)
return false;
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
// behaviour of the event by calling stop() on it
if (func.apply(this, args) === false && event && event.stop)
// behaviour of the event by calling stop() on it.
if (handlers[i].apply(this, args) === false && event && event.stop)
event.stop();
}, this);
}
return true;
},