Skip to content

Instantly share code, notes, and snippets.

@nelstrom
Created November 2, 2010 17:54
Show Gist options
  • Save nelstrom/660007 to your computer and use it in GitHub Desktop.
Save nelstrom/660007 to your computer and use it in GitHub Desktop.
What does the this.mon() function do?
demos.TouchImpl.TouchPad = Ext.extend(Ext.Component, {
id: 'touchpad',
html: 'Touch here!',
initComponent : function() {
this.addEvents('log');
demos.TouchImpl.TouchPad.superclass.initComponent.call(this);
},
afterRender: function() {
demos.TouchImpl.TouchPad.superclass.afterRender.call(this);
this.mon(this.el, {
touchstart: this.handleEvent,
touchend: this.handleEvent,
touchmove: this.handleEvent,
touchdown: this.handleEvent,
scrollstart: this.handleEvent,
scroll: this.handleEvent,
scrollend: this.handleEvent,
singletap: this.handleEvent,
tap: this.handleEvent,
doubletap: this.handleEvent,
taphold: this.handleEvent,
tapcancel: this.handleEvent,
swipe: this.handleEvent,
pinch: this.handleEvent,
pinchstart: this.handleEvent,
pinchend: this.handleEvent,
scope: this
});
},
handleEvent: function(e) {
this.fireEvent('log', e.type, e);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment