diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-11-13 19:48:22 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-13 19:48:22 -0500 |
commit | 3edc35691b7e20548bfcbbefd42f4ec8991f89f7 (patch) | |
tree | 2df3849bd30bad7dda4bf7ed1acb144b521cf1e9 /ext/mixed/js/display.js | |
parent | 3dd05eb400400407e254aaaa2d063833167591af (diff) |
Display updates (#1024)
* Update display generation to use new format assumptions
* Simplify how debug information is presented
Diffstat (limited to 'ext/mixed/js/display.js')
-rw-r--r-- | ext/mixed/js/display.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js index 69d94603..92020b51 100644 --- a/ext/mixed/js/display.js +++ b/ext/mixed/js/display.js @@ -721,6 +721,14 @@ class Display extends EventDispatcher { } } + _onDebugLogClick(e) { + const link = e.currentTarget; + const index = this._entryIndexFind(link); + if (index < 0 || index >= this._definitions.length) { return; } + const definition = this._definitions[index]; + console.log(definition); + } + _updateDocumentOptions(options) { const data = document.documentElement.dataset; data.ankiEnabled = `${options.anki.enable}`; @@ -771,6 +779,7 @@ class Display extends EventDispatcher { this.addMultipleEventListeners('.action-view-note', 'click', this._onNoteView.bind(this)); this.addMultipleEventListeners('.action-play-audio', 'click', this._onAudioPlay.bind(this)); this.addMultipleEventListeners('.kanji-link', 'click', this._onKanjiLookup.bind(this)); + this.addMultipleEventListeners('.debug-log-link', 'click', this._onDebugLogClick.bind(this)); if (this._options !== null && this._options.scanning.enablePopupSearch) { this.addMultipleEventListeners('.term-glossary-item, .tag', 'mouseup', this._onGlossaryMouseUp.bind(this)); this.addMultipleEventListeners('.term-glossary-item, .tag', 'mousedown', this._onGlossaryMouseDown.bind(this)); |