Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Re : Listen to custom events in can.Component?

$
0
0
Use transitionEnd, and check to make sure the event target is the element bound to, not a child element. 

  1.       '#list transitionend': 'refresh',
  2.       '#list webkitTransitionEnd': 'refresh',
  3.       '#list oTransitionEnd': 'refresh',
  4.       '#list MSTransitionEnd': 'refresh',
  5.       refresh: function( el, ev ) {
  6.         // Check to see if it's a change event, or otherwise that the event target is the dom element bound to, and not a child element
  7.         if(ev.type === 'change' || ev.target === el[0]) {
  8.             ....
  9.         }
  10.       }

Viewing all articles
Browse latest Browse all 3491

Trending Articles