mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update components
This commit is contained in:
parent
0f44fb37b3
commit
3acf184be7
6 changed files with 29 additions and 17 deletions
|
@ -82,8 +82,8 @@
|
|||
if (dlg.getAttribute('modal')) {
|
||||
dlg.showModal();
|
||||
} else {
|
||||
addBackdropOverlay(dlg);
|
||||
dlg.show();
|
||||
closeOnBackdropClick(dlg);
|
||||
dlg.showModal();
|
||||
}
|
||||
// Undo the auto-focus applied by the native dialog element
|
||||
safeBlur(document.activeElement);
|
||||
|
@ -116,6 +116,18 @@
|
|||
}
|
||||
}
|
||||
|
||||
function closeOnBackdropClick(dlg) {
|
||||
|
||||
dlg.addEventListener('click', function (event) {
|
||||
var rect = dlg.getBoundingClientRect();
|
||||
var isInDialog = (rect.top <= event.clientY && event.clientY <= rect.top + rect.height
|
||||
&& rect.left <= event.clientX && event.clientX <= rect.left + rect.width);
|
||||
if (!isInDialog) {
|
||||
close(dlg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function autoFocus(dlg) {
|
||||
|
||||
// The dialog may have just been created and webComponents may not have completed initialiazation yet.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue