Last active
November 12, 2015 20:49
-
-
Save jonwolfe/95370976b492feb57ccc to your computer and use it in GitHub Desktop.
This file contains 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
# general event handler | |
$.e = (selector, eventName, callback) -> | |
$(document).on eventName, selector, (event) => | |
el = $(event.currentTarget) | |
callback(event, el) | |
# click handler | |
$.click = (selector, callback) -> | |
$.e selector, 'click', callback | |
# example usage | |
$.click '[showmodal]', (e, el) -> | |
modal = $ el.attr('href') | |
show modal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment