Skip to content

Instantly share code, notes, and snippets.

@allenfantasy
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save allenfantasy/9180229 to your computer and use it in GitHub Desktop.
Save allenfantasy/9180229 to your computer and use it in GitHub Desktop.
Custom event configuration in Sencha Touch 2
// app.js : Use MyDoubleTap defined in MyLib/event/recognizer/MyDoubleTap.js
Ext.application({
eventPublisher:{
touchGestrure:{
recognizers:{
// call the new-defined class
doubleTap:{
xlass:'MyLib.event.recognizer.MyDoubleTap'
}
// OR set null to 'doubleTap'
// doubleTap: null
}
}
}
// more code beneath...
});
// MyLib/event/recognizer/MyDoubleTap.js
Ext.define('Mylib.event.recognizer.MyDoubleTap', {
extend:'Ext.event.recognizer.DoubleTap',
config:{
// default value is 300
maxDuration:10000;//=> two taps in 10s would be considered as doubletap
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment