SanSYS

Untitled

Jun 13th, 2015
5,286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var someWidget = {
  2.     init: function(container){
  3.         this.container = container;
  4.  
  5.         $(this.container).addEventListener('click', this.onItemClick);
  6.     },
  7.  
  8.     dispose: function(){
  9.         $(this.container).removeEventListener('click', this.onItemClick);
  10.     }
  11.  
  12.     onItemClick: function(e){
  13.         if(e.target.classList.contains('item')){
  14.             //some processor
  15.         }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment