mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update action sheet
This commit is contained in:
parent
79b9a76c6b
commit
c959aa01a2
22 changed files with 123 additions and 153 deletions
|
@ -722,9 +722,9 @@
|
|||
});
|
||||
}
|
||||
|
||||
require(['actionsheet'], function () {
|
||||
require(['actionsheet'], function (actionsheet) {
|
||||
|
||||
ActionSheetElement.show({
|
||||
actionsheet.show({
|
||||
items: menuItems,
|
||||
positionTo: positionTo,
|
||||
callback: function (id) {
|
||||
|
@ -994,9 +994,9 @@
|
|||
});
|
||||
}
|
||||
|
||||
require(['actionsheet'], function () {
|
||||
require(['actionsheet'], function (actionsheet) {
|
||||
|
||||
ActionSheetElement.show({
|
||||
actionsheet.show({
|
||||
items: items,
|
||||
positionTo: positionTo,
|
||||
callback: function (id) {
|
||||
|
@ -2766,9 +2766,9 @@
|
|||
};
|
||||
});
|
||||
|
||||
require(['actionsheet'], function () {
|
||||
require(['actionsheet'], function (actionsheet) {
|
||||
|
||||
ActionSheetElement.show({
|
||||
actionsheet.show({
|
||||
items: menuItems,
|
||||
positionTo: button,
|
||||
callback: function (id) {
|
||||
|
@ -2877,11 +2877,13 @@
|
|||
|
||||
showSortMenu: function (options) {
|
||||
|
||||
require(['paperdialoghelper', 'paper-dialog', 'paper-radio-button', 'paper-radio-group', 'scale-up-animation', 'fade-in-animation', 'fade-out-animation'], function (paperDialogHelper) {
|
||||
require(['paperdialoghelper', 'paper-radio-button', 'paper-radio-group'], function (paperDialogHelper) {
|
||||
|
||||
var dlg = paperDialogHelper.createDialog({
|
||||
removeOnClose: true,
|
||||
modal: false
|
||||
modal: false,
|
||||
entryAnimationDuration: 160,
|
||||
exitAnimationDuration: 200
|
||||
});
|
||||
|
||||
dlg.classList.add('ui-body-a');
|
||||
|
@ -2889,21 +2891,12 @@
|
|||
|
||||
var html = '';
|
||||
|
||||
// There seems to be a bug with this in safari causing it to immediately roll up to 0 height
|
||||
// Have to disable this right now because it's causing the radio buttons to not function properly in other browsers besides chrome
|
||||
var isScrollable = false;
|
||||
if (browserInfo.android) {
|
||||
isScrollable = true;
|
||||
}
|
||||
html += '<div style="margin:0;padding:1em 1em .7em;">';
|
||||
|
||||
html += '<h2>';
|
||||
html += '<h2 style="margin:0 0 .5em;">';
|
||||
html += Globalize.translate('HeaderSortBy');
|
||||
html += '</h2>';
|
||||
|
||||
if (isScrollable) {
|
||||
html += '<paper-dialog-scrollable>';
|
||||
}
|
||||
|
||||
html += '<paper-radio-group class="groupSortBy" selected="' + (options.query.SortBy || '').replace(',', '_') + '">';
|
||||
for (var i = 0, length = options.items.length; i < length; i++) {
|
||||
|
||||
|
@ -2913,17 +2906,14 @@
|
|||
}
|
||||
html += '</paper-radio-group>';
|
||||
|
||||
html += '<p style="margin: 1em 0;padding: 0 0 0 1.5em;">';
|
||||
html += '<h2 style="margin: 1em 0 .5em;">';
|
||||
html += Globalize.translate('HeaderSortOrder');
|
||||
html += '</p>';
|
||||
html += '</h2>';
|
||||
html += '<paper-radio-group class="groupSortOrder" selected="' + (options.query.SortOrder || 'Ascending') + '">';
|
||||
html += '<paper-radio-button name="Ascending" class="menuSortOrder block">' + Globalize.translate('OptionAscending') + '</paper-radio-button>';
|
||||
html += '<paper-radio-button name="Descending" class="menuSortOrder block">' + Globalize.translate('OptionDescending') + '</paper-radio-button>';
|
||||
html += '</paper-radio-group>';
|
||||
|
||||
if (isScrollable) {
|
||||
html += '</paper-dialog-scrollable>';
|
||||
}
|
||||
html += '</div>';
|
||||
|
||||
html += '<div class="buttons">';
|
||||
html += '<paper-button dialog-dismiss>' + Globalize.translate('ButtonClose') + '</paper-button>';
|
||||
|
@ -2933,16 +2923,13 @@
|
|||
document.body.appendChild(dlg);
|
||||
|
||||
var fireCallbackOnClose = false;
|
||||
var delay = browserInfo.animate ? 0 : 100;
|
||||
|
||||
setTimeout(function () {
|
||||
paperDialogHelper.open(dlg).then(function () {
|
||||
paperDialogHelper.open(dlg).then(function () {
|
||||
|
||||
if (options.callback && fireCallbackOnClose) {
|
||||
options.callback();
|
||||
}
|
||||
});
|
||||
}, delay);
|
||||
if (options.callback && fireCallbackOnClose) {
|
||||
options.callback();
|
||||
}
|
||||
});
|
||||
|
||||
$('.groupSortBy', dlg).on('iron-select', function () {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue