Last active
August 29, 2015 13:56
-
-
Save allenfantasy/9180229 to your computer and use it in GitHub Desktop.
Custom event configuration in Sencha Touch 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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... | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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