From 65c9f9584e292830c1e15875c967721eb905783a Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 16 Dec 2015 14:40:31 -0500 Subject: [PATCH] update events --- events.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/events.js b/events.js index ffdb6fc..ff05a1d 100644 --- a/events.js +++ b/events.js @@ -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); }); } };