1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/dashboard-ui/thirdparty/cordova/ios/actionsheet.js

37 lines
973 B
JavaScript
Raw Normal View History

2015-06-19 12:36:51 -04:00
(function () {
function show(options) {
// items
// positionTo
// showCancel
// title
var innerOptions = {
'title': options.title,
'buttonLabels': options.items.map(function (i) {
return i.name;
})
};
if (options.showCancel) {
innerOptions.addCancelButtonWithLabel = Globalize.translate('ButtonCancel');
}
// Depending on the buttonIndex, you can now call shareViaFacebook or shareViaTwitter
// of the SocialSharing plugin (https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin)
window.plugins.actionsheet.show(innerOptions, function (index) {
if (options.callback) {
if (index >= 1) {
options.callback(options.items[index - 1].id);
}
}
});
}
window.ActionSheetElement = {
show: show
};
})();