1
0
Fork 0
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:
Luke Pulverenti 2016-01-30 23:04:00 -05:00
parent 745df0d74b
commit ce8bc1a2f6
22 changed files with 123 additions and 153 deletions

View file

@ -1,6 +1,6 @@
define(['historyManager', 'focusManager', 'performanceManager', 'browser', 'paper-dialog', 'scale-up-animation', 'fade-out-animation', 'fade-in-animation', 'css!./paperdialoghelper.css'], function (historyManager, focusManager, performanceManager, browser) {
function paperDialogHashHandler(dlg, hash, resolve, lockDocumentScroll) {
function paperDialogHashHandler(dlg, hash, resolve) {
var self = this;
self.originalUrl = window.location.href;
@ -55,7 +55,7 @@
dlg.addEventListener('iron-overlay-closed', onDialogClosed);
dlg.open();
if (lockDocumentScroll !== false && !document.body.classList.contains('noScroll')) {
if (dlg.getAttribute('data-lockscroll') == 'true' && !document.body.classList.contains('noScroll')) {
document.body.classList.add('noScroll');
removeScrollLockOnClose = true;
}
@ -85,6 +85,19 @@
focusManager.autoFocus(e.target);
}
function shouldLockDocumentScroll(options) {
if (options.lockScroll != null) {
return options.lockScroll;
}
if (options.size == 'fullscreen') {
return true;
}
return browser.mobile;
}
function createDialog(options) {
options = options || {};
@ -94,6 +107,10 @@
dlg.setAttribute('with-backdrop', 'with-backdrop');
dlg.setAttribute('role', 'alertdialog');
if (shouldLockDocumentScroll(options)) {
dlg.setAttribute('data-lockscroll', 'true');
}
// without this safari will scroll the background instead of the dialog contents
// but not needed here since this is already on top of an existing dialog
// but skip it in IE because it's causing the entire browser to hang