summaryrefslogtreecommitdiff
path: root/ext/fg/js/frontend.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-17 18:39:12 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-17 18:40:43 -0400
commit8f918c63dcf82bfcdba47100194b34e4be2dd531 (patch)
tree88bc1d06864ad0f0db8756c0f5bd3c03b456fff4 /ext/fg/js/frontend.js
parent598cd32946c8e10e5aa3fcec26e3fc40af44bddf (diff)
Reposition popup on window resize rather than clear the search
Fixes #107
Diffstat (limited to 'ext/fg/js/frontend.js')
-rw-r--r--ext/fg/js/frontend.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js
index eddbf9cc..45d24329 100644
--- a/ext/fg/js/frontend.js
+++ b/ext/fg/js/frontend.js
@@ -139,8 +139,14 @@ class Frontend {
}
}
- onResize() {
- this.searchClear(false);
+ async onResize() {
+ if (this.textSourceLast !== null && await this.popup.isVisibleAsync()) {
+ const textSource = this.textSourceLast;
+ this.lastShowPromise = this.popup.showContent(
+ textSource.getRect(),
+ textSource.getWritingMode()
+ );
+ }
}
onClick(e) {