From: Raphaƫl Jakse Date: Sun, 12 Apr 2020 18:14:15 +0000 (+0200) Subject: Use [].slice.call when iterating over node lists X-Git-Url: https://secure.softndesign.org/git/?a=commitdiff_plain;h=ba930e5ef67769bf5bf5705398ff12ba2a65bd03;p=trivabble.git Use [].slice.call when iterating over node lists This is needed on Safari 9, used on the iPad 2. --- 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 {