summaryrefslogtreecommitdiff
path: root/ext/fg/js/popup.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-09-23 12:42:02 -0700
committerAlex Yatskov <alex@foosoft.net>2017-09-23 12:42:02 -0700
commit327027d820759c62f50454822c11c0b8859c1d04 (patch)
tree3a13a25634b7eaf702634a3d6baeb8806c48ab02 /ext/fg/js/popup.js
parent2eb85cb835a4aece7839eba25c0030e9eb186f85 (diff)
parentd13cb09fae53834baaac254d7b55d02a26f4a5c0 (diff)
Merge branch 'dev'
Diffstat (limited to 'ext/fg/js/popup.js')
-rw-r--r--ext/fg/js/popup.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js
index 03958832..d1009fe9 100644
--- a/ext/fg/js/popup.js
+++ b/ext/fg/js/popup.js
@@ -100,6 +100,21 @@ class Popup {
return this.injected && this.container.style.visibility !== 'hidden';
}
+ containsPoint(point) {
+ if (!this.isVisible()) {
+ return false;
+ }
+
+ const rect = this.container.getBoundingClientRect();
+ const contained =
+ point.x >= rect.left &&
+ point.y >= rect.top &&
+ point.x < rect.right &&
+ point.y < rect.bottom;
+
+ return contained;
+ }
+
async termsShow(elementRect, definitions, options, context) {
await this.show(elementRect, options);
this.invokeApi('termsShow', {definitions, options, context});