Created
June 5, 2012 14:27
-
-
Save rubenfonseca/2875339 to your computer and use it in GitHub Desktop.
Custom menu on Sharekit
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
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(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the list of sharers names are inside the documentation/ folder