mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-19 03:48:18 -07:00
38 lines
1.0 KiB
JavaScript
38 lines
1.0 KiB
JavaScript
(function () {
|
|
|
|
function show(options) {
|
|
|
|
// items
|
|
// positionTo
|
|
// showCancel
|
|
// title
|
|
|
|
var innerOptions = {
|
|
'title': options.title,
|
|
'buttonLabels': options.items.map(function (i) {
|
|
return i.name;
|
|
})
|
|
};
|
|
|
|
// Show cancel unless the caller explicitly set it to false
|
|
if (options.showCancel !== false) {
|
|
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
|
|
};
|
|
})(); |