diff options
Diffstat (limited to 'web/static/dartboat.js')
-rw-r--r-- | web/static/dartboat.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/web/static/dartboat.js b/web/static/dartboat.js index 22c0728..eb1b8fa 100644 --- a/web/static/dartboat.js +++ b/web/static/dartboat.js @@ -122,9 +122,12 @@ function flipControls(store_opt = true) { document.addEventListener('DOMContentLoaded', () => { let f; - f = e => e.target.dataset.command.split(';').forEach(x => - promptHandle(...x.split(':', 2))); - $$('[data-command]').forEach(x => x.addEventListener('click', f)); + $('#controls').addEventListener('click', e => { + const command = e.target.dataset.command; + if (!command) return; + command.split(';').forEach(x => + promptHandle(...x.split(':', 2))); + }); f = e => _set_opt(toCString(e.target.dataset.opt), toCString(e.target.value)); |