From 1109667cd4ee5336fe8ec5f66edeb127e9e1eb56 Mon Sep 17 00:00:00 2001 From: Joe Esposito Date: Mon, 5 Dec 2011 10:44:19 -0500 Subject: [PATCH] Added the 'eventTransform' option to allow event transformations coming from a JSON event source. --- src/EventManager.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/EventManager.js b/src/EventManager.js index 4d159ab..44aa44a 100644 --- a/src/EventManager.js +++ b/src/EventManager.js @@ -122,6 +122,7 @@ function EventManager(options, _sources) { } }else{ var url = source.url; + var eventTransform = source.eventTransform || options.eventTransform; if (url) { var success = source.success; var error = source.error; @@ -144,7 +145,9 @@ function EventManager(options, _sources) { if ($.isArray(res)) { events = res; } - callback(events); + callback(events && eventTransform + ? $.map(events, eventTransform) + : events); }, error: function() { applyAll(error, this, arguments);