Last active
December 21, 2015 17:58
-
-
Save tkh44/6343624 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parse: function (events, options) { | |
var eventKeys = _.keys(events || {}), | |
limitEvents, | |
parsedEvents = []; | |
// Optionally filter using set of acceptable event types | |
limitEvents = options.only; | |
eventKeys = _.filter(eventKeys, function checkEventName (eventKey) { | |
// Parse event string into semantic representation | |
var event = Framework.Util.parseDOMEvent(eventKey); | |
// Optional filter | |
if (limitEvents && !_.contains(limitEvents, event.name)) { | |
return false; | |
} | |
parsedEvents.push(event); | |
return true; | |
}); | |
return parsedEvents; | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment