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
59c19c458f
commit
0f44fb37b3
13 changed files with 97 additions and 118 deletions
|
@ -99,7 +99,7 @@
|
|||
animateDialogOpen(dlg);
|
||||
|
||||
if (dlg.getAttribute('data-autofocus') == 'true') {
|
||||
focusManager.autoFocus(dlg);
|
||||
autoFocus(dlg);
|
||||
}
|
||||
|
||||
if (dlg.getAttribute('data-lockscroll') == 'true' && !document.body.classList.contains('noScroll')) {
|
||||
|
@ -116,6 +116,22 @@
|
|||
}
|
||||
}
|
||||
|
||||
function autoFocus(dlg) {
|
||||
|
||||
// The dialog may have just been created and webComponents may not have completed initialiazation yet.
|
||||
// Without this, seeing some script errors in Firefox
|
||||
|
||||
var delay = browser.animate ? 0 : 500;
|
||||
if (!delay) {
|
||||
focusManager.autoFocus(dlg);
|
||||
return;
|
||||
}
|
||||
|
||||
setTimeout(function () {
|
||||
focusManager.autoFocus(dlg);
|
||||
}, delay);
|
||||
}
|
||||
|
||||
function safeBlur(el) {
|
||||
if (el && el.blur && el != document.body) {
|
||||
el.blur();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue