summaryrefslogtreecommitdiff
path: root/ext/fg/js/frame.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fg/js/frame.js')
-rw-r--r--ext/fg/js/frame.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/fg/js/frame.js b/ext/fg/js/frame.js
index 165a9795..8f3d3877 100644
--- a/ext/fg/js/frame.js
+++ b/ext/fg/js/frame.js
@@ -18,7 +18,7 @@
function registerKanjiLinks() {
- for (let link of [].slice.call(document.getElementsByClassName('kanji-link'))) {
+ for (const link of Array.from(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 (let link of [].slice.call(document.getElementsByClassName('action-add-note'))) {
+ for (const link of Array.from(document.getElementsByClassName('action-add-note'))) {
link.addEventListener('click', (e) => {
e.preventDefault();
const ds = e.currentTarget.dataset;
@@ -37,7 +37,7 @@ function registerAddNoteLinks() {
}
function registerAudioLinks() {
- for (let link of [].slice.call(document.getElementsByClassName('action-play-audio'))) {
+ for (const link of Array.from(document.getElementsByClassName('action-play-audio'))) {
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 (let mode in state) {
+ for (const 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;