aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/frame.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-09-14 22:34:05 -0700
committerAlex Yatskov <alex@foosoft.net>2016-09-14 22:34:05 -0700
commit0eb54e24c6c290d8aa2df1e5f6c52ae35e35ca1a (patch)
treec4881a4ddb7ac26fdc1e4956b6843727d7067aca /ext/fg/js/frame.js
parent07a1f94806756d96344b52fd185c2bdc0495edf6 (diff)
Deleting dead options
Diffstat (limited to 'ext/fg/js/frame.js')
-rw-r--r--ext/fg/js/frame.js27
1 files changed, 12 insertions, 15 deletions
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);
+ }
+});