diff options
author | Alex Yatskov <alex@foosoft.net> | 2019-09-23 17:35:36 -0700 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2019-09-23 17:35:36 -0700 |
commit | f4b6527ed6ed1f0f4f5a63b94766b20f3b90e6ec (patch) | |
tree | 0d2f733c13597dd4067d3dc01e6da27f96bfe81b /ext/mixed | |
parent | cfc6363a01ee00e89866c54709006d6f55d093de (diff) | |
parent | f5afe590ad0730a695614b32032b7ea70b46c7b0 (diff) |
Merge branch 'master' into testing
Diffstat (limited to 'ext/mixed')
-rw-r--r-- | ext/mixed/js/display.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js index ebf56897..ca1738a6 100644 --- a/ext/mixed/js/display.js +++ b/ext/mixed/js/display.js @@ -27,6 +27,7 @@ class Display { this.sequence = 0; this.index = 0; this.audioCache = {}; + this.optionsContext = {}; this.dependencies = {}; @@ -66,7 +67,7 @@ class Display { context.source.source = this.context.source; } - const kanjiDefs = await apiKanjiFind(link.text()); + const kanjiDefs = await apiKanjiFind(link.text(), this.optionsContext); this.kanjiShow(kanjiDefs, this.options, context); } catch (e) { this.onError(e); @@ -80,7 +81,7 @@ class Display { const {docRangeFromPoint, docSentenceExtract} = this.dependencies; const clickedElement = $(e.target); - const textSource = docRangeFromPoint({x: e.clientX, y: e.clientY}, this.options); + const textSource = docRangeFromPoint(e.clientX, e.clientY, this.options); if (textSource === null) { return false; } @@ -89,7 +90,7 @@ class Display { try { textSource.setEndOffset(this.options.scanning.length); - ({definitions, length} = await apiTermsFind(textSource.text())); + ({definitions, length} = await apiTermsFind(textSource.text(), this.optionsContext)); if (definitions.length === 0) { return false; } @@ -379,7 +380,7 @@ class Display { async adderButtonUpdate(modes, sequence) { try { - const states = await apiDefinitionsAddable(this.definitions, modes); + const states = await apiDefinitionsAddable(this.definitions, modes, this.optionsContext); if (!states || sequence !== this.sequence) { return; } @@ -453,7 +454,7 @@ class Display { } } - const noteId = await apiDefinitionAdd(definition, mode, context); + const noteId = await apiDefinitionAdd(definition, mode, context, this.optionsContext); if (noteId) { const index = this.definitions.indexOf(definition); Display.adderButtonFind(index, mode).addClass('disabled'); |