Fix compatibility with older browsers (webOS 2/3)
This commit is contained in:
parent
e907350700
commit
22d0a5705d
1 changed files with 9 additions and 2 deletions
|
@ -28,6 +28,13 @@ define(["focusManager", "layoutManager"], function (focusManager, layoutManager)
|
|||
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.
|
||||
*/
|
||||
|
@ -55,8 +62,8 @@ define(["focusManager", "layoutManager"], function (focusManager, layoutManager)
|
|||
candidates.push(activeElement);
|
||||
}
|
||||
|
||||
candidates = candidates.concat(Array.from(container.querySelectorAll(".btnResume")));
|
||||
candidates = candidates.concat(Array.from(container.querySelectorAll(".btnPlay")));
|
||||
candidates = candidates.concat(arrayFrom(container.querySelectorAll(".btnResume")));
|
||||
candidates = candidates.concat(arrayFrom(container.querySelectorAll(".btnPlay")));
|
||||
|
||||
var notFound = candidates.every(function (element) {
|
||||
if (focusManager.isCurrentlyFocusable(element)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue