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

Fix compatibility with older browsers (webOS 2/3)

This commit is contained in:
Dmitry Lyzo 2019-11-14 23:55:44 +03:00
parent e907350700
commit 22d0a5705d

View file

@ -28,6 +28,13 @@ define(["focusManager", "layoutManager"], function (focusManager, layoutManager)
console.log("AutoFocuser enabled"); console.log("AutoFocuser enabled");
} }
/**
* Create an array from some source.
*/
var arrayFrom = Array.prototype.from || function (src) {
return Array.prototype.slice.call(src);
}
/** /**
* Set focus on a suitable element, taking into account the previously selected. * Set focus on a suitable element, taking into account the previously selected.
*/ */
@ -55,8 +62,8 @@ define(["focusManager", "layoutManager"], function (focusManager, layoutManager)
candidates.push(activeElement); candidates.push(activeElement);
} }
candidates = candidates.concat(Array.from(container.querySelectorAll(".btnResume"))); candidates = candidates.concat(arrayFrom(container.querySelectorAll(".btnResume")));
candidates = candidates.concat(Array.from(container.querySelectorAll(".btnPlay"))); candidates = candidates.concat(arrayFrom(container.querySelectorAll(".btnPlay")));
var notFound = candidates.every(function (element) { var notFound = candidates.every(function (element) {
if (focusManager.isCurrentlyFocusable(element)) { if (focusManager.isCurrentlyFocusable(element)) {