From ba930e5ef67769bf5bf5705398ff12ba2a65bd03 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Jakse?= Date: Sun, 12 Apr 2020 20:14:15 +0200 Subject: [PATCH] Use [].slice.call when iterating over node lists This is needed on Safari 9, used on the iPad 2. --- trivabble.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trivabble.js b/trivabble.js index 7e04eda..4281e37 100644 --- a/trivabble.js +++ b/trivabble.js @@ -185,7 +185,7 @@ tileDest.appendChild(movingTile); if (isParentOf(board, tileDest)) { - for (const tile of board.getElementsByClassName("tile-highlight")) { + for (const tile of [].slice.call(board.getElementsByClassName("tile-highlight"))) { tile.classList.remove("tile-highlight"); } } @@ -1158,7 +1158,7 @@ let tile; } trivabble.applyL10n = function () { - for (const node of document.querySelectorAll("[data-l10n]")) { + for (const node of [].slice.call(document.querySelectorAll("[data-l10n]"))) { if (node.dataset.l10n === "text-content") { node.textContent = _(node.textContent.trim()); } else { -- 2.30.2