Report abuse

function hasListener(element) {
  element = $(element)
  var id = null
  if (element === window) id = 1
  else if (element._prototypeEventID) id = element._prototypeEventID[0]
  if (id) {
    var cache = Event.cache[id]
    return cache && Object.keys(cache).without('element').length > 0
  }
  return false
}