Skip to content
This repository has been archived by the owner on Dec 9, 2023. It is now read-only.

Commit

Permalink
update events
Browse files Browse the repository at this point in the history
  • Loading branch information
LukePulverenti committed Dec 16, 2015
1 parent 39cb03c commit 65c9f95
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions events.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,20 @@
});
},

trigger: function (obj, eventName, data) {
trigger: function (obj, eventName) {

var eventObject = {
type: name,
detail: data
type: eventName
};

var eventArgs = [];
eventArgs.push(eventObject);
for (var i = 2, length = arguments.length; i < length; i++) {
eventArgs.push(arguments[i]);
}

getCallbacks(obj, eventName).forEach(function (c) {
c.call(obj, eventObject);
c.apply(obj, eventArgs);
});
}
};
Expand Down

0 comments on commit 65c9f95

Please sign in to comment.