1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

switch to shared paperdialoghelper

This commit is contained in:
Luke Pulverenti 2016-01-30 15:59:09 -05:00
parent 1cd7f5bac7
commit 024642e556
24 changed files with 152 additions and 296 deletions

View file

@ -1,17 +1,19 @@
.paperDialog {
margin: 0;
top: 0;
left: 0;
right: 0;
bottom: 0;
position: fixed;
max-width: none !important;
max-height: none !important;
display: flex;
align-items: center;
justify-content: center;
}
.paperDialog.fixedSize {
position: fixed !important;
top: 0 !important;
bottom: 0 !important;
left: 0 !important;
right: 0 !important;
margin: 0 !important;
border-radius: 0 !important;
max-height: none !important;
max-width: none !important;
}
.paperDialog.scrollY {
overflow-y: auto;
-webkit-overflow-scrolling: touch;
@ -25,4 +27,36 @@
.paperDialog.hiddenScroll {
-ms-overflow-style: none;
overflow: -moz-scrollbars-none;
}
}
@media all and (min-width: 1280px) and (min-height: 720px) {
.paperDialog.medium {
top: 10% !important;
bottom: 10% !important;
left: 10% !important;
right: 10% !important;
}
.paperDialog.small {
top: 10% !important;
bottom: 10% !important;
left: 20% !important;
right: 20% !important;
}
}
@media all and (min-width: 1280px) and (min-height: 720px) {
.paperDialog.fullscreen-border {
top: 5% !important;
bottom: 5% !important;
left: 5% !important;
right: 5% !important;
}
}
.noScroll {
overflow-x: hidden !important;
overflow-y: hidden !important;
}

View file

@ -5,6 +5,7 @@
var self = this;
self.originalUrl = window.location.href;
var activeElement = document.activeElement;
var removeScrollLockOnClose = false;
function onHashChange(e) {
@ -22,9 +23,8 @@
function onDialogClosed() {
if (lockDocumentScroll !== false) {
// TODO
//Dashboard.onPopupClose();
if (removeScrollLockOnClose) {
document.body.classList.remove('noScroll');
}
window.removeEventListener('popstate', onHashChange);
@ -55,9 +55,9 @@
dlg.addEventListener('iron-overlay-closed', onDialogClosed);
dlg.open();
if (lockDocumentScroll !== false) {
// TODO
//Dashboard.onPopupOpen();
if (lockDocumentScroll !== false && !document.body.classList.contains('noScroll')) {
document.body.classList.add('noScroll');
removeScrollLockOnClose = true;
}
historyManager.pushState({ dialogId: hash }, "Dialog", hash);
@ -135,7 +135,14 @@
dlg.setAttribute('data-removeonclose', 'true');
}
dlg.addEventListener('iron-overlay-opened', onDialogOpened);
if (options.size) {
dlg.classList.add('fixedSize');
dlg.classList.add(options.size);
}
if (options.autoFocus !== false) {
dlg.addEventListener('iron-overlay-opened', onDialogOpened);
}
return dlg;
}