diff options
Diffstat (limited to 'ext/fg/js/popup.js')
-rw-r--r-- | ext/fg/js/popup.js | 15 |
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}); |