ManuelDeLeon / viewmodel

MVVM for Meteor
https://viewmodel.org
MIT License
205 stars 23 forks source link

Prevent event bubbling ? #254

Closed daveeel closed 8 years ago

daveeel commented 8 years ago

Hi @ManuelDeLeon , is there a simple way to prevent the click on span to bubble up to div?

    div($b="click:clickMe('DIV')") DIV
      span($b="click:clickMe('SPAN')") SPAN
    clickMe: (p)->
      console.log "clickMe: #{p}"
ManuelDeLeon commented 8 years ago

See http://api.jquery.com/event.stopPropagation/ On May 20, 2016 4:18 AM, "Dave Lee" notifications@github.com wrote:

Hi @ManuelDeLeon https://github.com/ManuelDeLeon , is there a simple way to prevent the click on span to bubble up to div?

div($b="click:clickMe('DIV')") DIV
  span($b="click:clickMe('SPAN')") SPAN

clickMe: (p)->
  console.log "clickMe: #{p}"

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/ManuelDeLeon/viewmodel/issues/254

daveeel commented 8 years ago

not as clean as I expect. thanks anyway :)

ManuelDeLeon commented 8 years ago

If you're doing that a lot then create a "noBubbleClick" custom binding. On May 21, 2016 8:07 AM, "Dave Lee" notifications@github.com wrote:

not as clean as I expect. thanks anyway :)

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/ManuelDeLeon/viewmodel/issues/254#issuecomment-220779679