diff options
| author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-10-12 12:59:51 -0400 | 
|---|---|---|
| committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-10-12 15:44:32 -0400 | 
| commit | be7fa57d5ced7f6969c5d66f0a35fafb9de3bcee (patch) | |
| tree | 35d7e02c9d49adb2bb42ccba0dc7f241d7da2eb3 /ext/fg/js | |
| parent | 537d2ef532aa7b7498de13ab039bd23f28d32714 (diff) | |
Add support for a popup preview
Diffstat (limited to 'ext/fg/js')
| -rw-r--r-- | ext/fg/js/frontend.js | 8 | 
1 files changed, 5 insertions, 3 deletions
| diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js index 52a23889..3ddeae78 100644 --- a/ext/fg/js/frontend.js +++ b/ext/fg/js/frontend.js @@ -44,6 +44,8 @@ class Frontend {          this.isPreparedPromiseResolve = null;          this.isPreparedPromise = new Promise((resolve) => { this.isPreparedPromiseResolve = resolve; }); + +        this.lastShowPromise = Promise.resolve();      }      static create() { @@ -331,7 +333,7 @@ class Frontend {          } catch (e) {              if (window.yomichan_orphaned) {                  if (textSource && this.options.scanning.modifier !== 'none') { -                    this.popup.showOrphaned( +                    this.lastShowPromise = this.popup.showOrphaned(                          textSource.getRect(),                          textSource.getWritingMode()                      ); @@ -369,7 +371,7 @@ class Frontend {          const sentence = docSentenceExtract(textSource, this.options.anki.sentenceExt);          const url = window.location.href; -        this.popup.termsShow( +        this.lastShowPromise = this.popup.termsShow(              textSource.getRect(),              textSource.getWritingMode(),              definitions, @@ -399,7 +401,7 @@ class Frontend {          const sentence = docSentenceExtract(textSource, this.options.anki.sentenceExt);          const url = window.location.href; -        this.popup.kanjiShow( +        this.lastShowPromise = this.popup.kanjiShow(              textSource.getRect(),              textSource.getWritingMode(),              definitions, |