Skip to content

Instantly share code, notes, and snippets.

@nebiros
Created September 12, 2010 20:42
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 nebiros/576440 to your computer and use it in GitHub Desktop.
Save nebiros/576440 to your computer and use it in GitHub Desktop.
Titanium hold menu
var holdTime = 2000, timeout;
productView.addEventListener( "touchstart", function ( e ) {
timeout = setTimeout( function( e ) {
// you function here. e.source is you tableViewRow.
var dialog = Titanium.UI.createOptionDialog( {
options: ["Notificar precio"],
destructive: 2,
cancel: 1,
title: "Opciones"
} );
dialog.addEventListener( "click", function( e ) {
switch ( parseInt( e.index ) ) {
case 0:
/* do something */
break;
}
} );
dialog.show();
}, holdTime );
} );
productView.addEventListener( "touchend", function ( e ) {
clearTimeout( timeout );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment