From ad617221308b04e8f26ec52d876603e7aec3a03d Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Tue, 14 Jun 2016 16:07:23 -0400 Subject: Use `let` instead of `const` in for loops. --- ext/fg/js/frame.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ext/fg') diff --git a/ext/fg/js/frame.js b/ext/fg/js/frame.js index 339958f2..9c4b9318 100644 --- a/ext/fg/js/frame.js +++ b/ext/fg/js/frame.js @@ -18,7 +18,7 @@ function registerKanjiLinks() { - for (const link of [].slice.call(document.getElementsByClassName('kanji-link'))) { + for (let link of [].slice.call(document.getElementsByClassName('kanji-link'))) { link.addEventListener('click', (e) => { e.preventDefault(); window.parent.postMessage({action: 'displayKanji', params: e.target.innerHTML}, '*'); @@ -27,7 +27,7 @@ function registerKanjiLinks() { } function registerAddNoteLinks() { - for (const link of [].slice.call(document.getElementsByClassName('action-add-note'))) { + for (let link of [].slice.call(document.getElementsByClassName('action-add-note'))) { link.addEventListener('click', (e) => { e.preventDefault(); const ds = e.currentTarget.dataset; @@ -37,7 +37,7 @@ function registerAddNoteLinks() { } function registerPronounceLinks() { - for (const link of [].slice.call(document.getElementsByClassName('action-pronounce'))) { + for (let link of [].slice.call(document.getElementsByClassName('action-pronounce'))) { link.addEventListener('click', (e) => { e.preventDefault(); const ds = e.currentTarget.dataset; @@ -60,7 +60,7 @@ function onMessage(e) { } function api_setActionState({index, state, sequence}) { - for (const mode in state) { + for (let mode in state) { const matches = document.querySelectorAll(`.action-bar[data-sequence="${sequence}"] .action-add-note[data-index="${index}"][data-mode="${mode}"]`); if (matches.length === 0) { return; -- cgit v1.2.3