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

update components

This commit is contained in:
Luke Pulverenti 2016-03-23 22:29:49 -04:00
parent 59c19c458f
commit 0f44fb37b3
13 changed files with 97 additions and 118 deletions

View file

@ -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();