Created
May 13, 2014 10:12
-
-
Save ourmaninamsterdam/560ccdf106d96b620eb0 to your computer and use it in GitHub Desktop.
Partially applied fn [WIP]
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
function delegateEvent(selector, handler) { | |
var that = this; | |
return function(e) { | |
var elem = e.target; | |
if(new RegExp(selector,'gi').test(elem.className)){ | |
if(typeof handler === 'function'){ | |
return handler; | |
} | |
} | |
return this; | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment