Skip to content

Instantly share code, notes, and snippets.

@rubenfonseca
Created June 5, 2012 14:27
Show Gist options
  • Save rubenfonseca/2875339 to your computer and use it in GitHub Desktop.
Save rubenfonseca/2875339 to your computer and use it in GitHub Desktop.
Custom menu on Sharekit
var dialog = Ti.UI.createOptionsDialog({
title: "Share",
options: ['Twitter', 'Facebook', 'Mail', 'Cancel'],
cancel: 3 // index of cancel option
});
dialog.addEventListener('click', function(e) {
if(e.index == e.cancel) { return; }
var sharer = null;
switch(e.index) {
case 0:
sharer = 'Twitter'
break;
case 1:
sharer = 'Facebook'
break;
case 2:
sharer = 'Mail'
break;
}
sharekit.share({
title: 'Title',
text: 'Text',
sharer: sharer, // here it is :)
view: view // always specifiy the view that originated the share event
});
});
dialog.show();
@rubenfonseca
Copy link
Author

the list of sharers names are inside the documentation/ folder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment