aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/frame.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-08-20 19:32:50 -0700
committerAlex Yatskov <alex@foosoft.net>2016-08-20 19:32:50 -0700
commit8416c9d633ed15f679c9871b9940731fb9a7b386 (patch)
tree1c951a141d1135266e8867d2b5ac1f5d442bf7a2 /ext/fg/js/frame.js
parent18fc8d9865406a74dbea47f49ac959a543035ec7 (diff)
More cleanup
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;