aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-12 12:59:51 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-12 15:44:32 -0400
commitbe7fa57d5ced7f6969c5d66f0a35fafb9de3bcee (patch)
tree35d7e02c9d49adb2bb42ccba0dc7f241d7da2eb3 /ext/fg/js
parent537d2ef532aa7b7498de13ab039bd23f28d32714 (diff)
Add support for a popup preview
Diffstat (limited to 'ext/fg/js')
-rw-r--r--ext/fg/js/frontend.js8
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,