Skip to content

Latest commit

 

History

History
20 lines (16 loc) · 559 Bytes

README.md

File metadata and controls

20 lines (16 loc) · 559 Bytes

EventFish

Cast your net on a root element and catch all event matching selectors on your watch list.

var net = new EventFish(document.body)

net.addWatchList('click', 'div.capture', function(e){
  console.log('this div got clicked')
})

net.addWatchList('click', 'a.capture', function(e){
  // this will fail silently because passive listener by default
  // for performance reason
  e.preventDefault()
  console.log('this a got clicked and preventDefault ignored')
})

// to preventDefault
new EventFish(document.body, {passive: false})