bean icon indicating copy to clipboard operation
bean copied to clipboard

Missing Support for DOM Level 2: handleEvent (Interface EventListener)

Open digitarald opened this issue 14 years ago • 4 comments

bean does not handle a neat pattern from the DOM Level 2 Events: Interface EventListener

It doesn't support handleEvent. I could just give a class instance to the event handler, I don't need to handle the scope.

Example:

class App
  constructor: ->  
    @element = $ '#app'
    @element.bind 'dblclick', this

  handleEvent: (event) ->
    switch event.type
      when 'dblclick' then @addEmptyChild event.pageX, event.pageY`

digitarald avatar May 20 '11 06:05 digitarald

I forked and will see if I can find a valid fix for nativeHandler and customHandler to handle that. Important to note is also the different scope handling, since handleEvent is not called with the event target as scope.

digitarald avatar May 20 '11 06:05 digitarald

ahh yeah that is cool! -- it would be much appreciated if you could get that working! :)

fat avatar May 20 '11 06:05 fat

@fat -- this looks like the thing i was showing you a while back...

on('click', {
  handleEvent: function () {

  }
}, false)

ded avatar May 21 '11 17:05 ded

yep, i think so

fat avatar May 21 '11 17:05 fat