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-08-04 13:15:34 -04:00
parent 4467991a07
commit 0c9d201edd
4 changed files with 42 additions and 16 deletions

View file

@ -1,12 +1,17 @@
define(['dom'], function (dom) {
function autoFocus(view, defaultToFirst) {
function autoFocus(view, defaultToFirst, findAutoFocusElement) {
var element = view.querySelector('*[autofocus]');
if (element) {
focus(element);
return element;
} else if (defaultToFirst !== false) {
var element;
if (findAutoFocusElement !== false) {
element = view.querySelector('*[autofocus]');
if (element) {
focus(element);
return element;
}
}
if (defaultToFirst !== false) {
element = getFocusableElements(view)[0];
if (element) {
@ -190,7 +195,7 @@ define(['dom'], function (dom) {
var container = activeElement ? getFocusContainer(activeElement, direction) : document.body;
if (!activeElement) {
autoFocus(container, true);
autoFocus(container, true, false);
return;
}