From 0eb54e24c6c290d8aa2df1e5f6c52ae35e35ca1a Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Wed, 14 Sep 2016 22:34:05 -0700 Subject: Deleting dead options --- ext/fg/js/frame.js | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'ext/fg/js') diff --git a/ext/fg/js/frame.js b/ext/fg/js/frame.js index 30cb7c73..d06e8b94 100644 --- a/ext/fg/js/frame.js +++ b/ext/fg/js/frame.js @@ -46,19 +46,6 @@ function registerAudioLinks() { } } -function onDomContentLoaded() { - registerKanjiLinks(); - registerAddNoteLinks(); - registerAudioLinks(); -} - -function onMessage(e) { - const {action, params} = e.data, method = window['api_' + action]; - if (typeof(method) === 'function') { - method(params); - } -} - function api_setActionState({index, state, sequence}) { for (const mode in state) { const matches = document.querySelectorAll(`.action-bar[data-sequence="${sequence}"] .action-add-note[data-index="${index}"][data-mode="${mode}"]`); @@ -75,5 +62,15 @@ function api_setActionState({index, state, sequence}) { } } -document.addEventListener('DOMContentLoaded', onDomContentLoaded, false); -window.addEventListener('message', onMessage); +document.addEventListener('DOMContentLoaded', () => { + registerKanjiLinks(); + registerAddNoteLinks(); + registerAudioLinks(); +}); + +window.addEventListener('message', () => { + const {action, params} = e.data, method = window['api_' + action]; + if (typeof(method) === 'function') { + method(params); + } +}); -- cgit v1.2.3