substantially improve the fire method of events, allowing unlimited event args to be passed in now.

This commit is contained in:
Damien Churchill 2009-02-20 22:59:56 +00:00
parent 7279755f24
commit a9fb98c23a

View File

@ -6,11 +6,13 @@ var Deluge = {
Deluge.Events = {
_events: new Hash(),
fire: function(eventName, arg) {
fire: function() {
arguments = $A(arguments);
var eventName = arguments.shift();
var eventArgs = arguments;
if (!this._events[eventName]) return;
$each(this._events[eventName], function(fn) {
if ($type(fn) != 'function') return;
fn(arg);
fn.attempt(eventArgs);
});
},