mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-02 14:44:21 +00:00
substantially improve the fire method of events, allowing unlimited event args to be passed in now.
This commit is contained in:
parent
7279755f24
commit
a9fb98c23a
@ -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);
|
||||
});
|
||||
},
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user