Skip to content

Instantly share code, notes, and snippets.

@jonwolfe
Last active November 12, 2015 20:27
Show Gist options
  • Save jonwolfe/5b4d63b9df7a54cae928 to your computer and use it in GitHub Desktop.
Save jonwolfe/5b4d63b9df7a54cae928 to your computer and use it in GitHub Desktop.
$.fn.e = (eventName, callback) ->
console.log 'eventName: ' + eventName + ' callback: ' + callback
$(document).on eventName, this, (event) =>
console.log 'this.html(): ' + this.html() + ' event.currentTarget: ' + event.currentTarget
el = $(event.currentTarget)
callback(event, el)
$('[showmodal]').e 'click', (e, el) ->
href = el.attr('href')
console.log 'click callback called! modal: ' + href
modal = $ href
show modal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment