aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/popup.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-09-08 19:40:15 -0400
committerGitHub <noreply@github.com>2020-09-08 19:40:15 -0400
commitb687870a55eae43a71ea3adc41be0ab341a8721f (patch)
tree55b5046b6c2f9513edf09307c05cc50d3468ae67 /ext/fg/js/popup.js
parentab4dbacc4c36d6373e22f758eefdb7514dc7cdb9 (diff)
Delay hide option (#774)
* Add hideDelay option * Add _clearSelection * Use hideDelay * Prevent repeated delayed selection clears * Fix popup hide timer being cleared when the cursor is moved into the frame
Diffstat (limited to 'ext/fg/js/popup.js')
-rw-r--r--ext/fg/js/popup.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js
index f644ee98..ee3bf646 100644
--- a/ext/fg/js/popup.js
+++ b/ext/fg/js/popup.js
@@ -95,6 +95,8 @@ class Popup extends EventDispatcher {
// Public functions
prepare() {
+ this._frame.addEventListener('mouseover', this._onFrameMouseOver.bind(this));
+ this._frame.addEventListener('mouseout', this._onFrameMouseOut.bind(this));
this._frame.addEventListener('mousedown', (e) => e.stopPropagation());
this._frame.addEventListener('scroll', (e) => e.stopPropagation());
this._frame.addEventListener('load', this._onFrameLoad.bind(this));
@@ -207,6 +209,14 @@ class Popup extends EventDispatcher {
// Private functions
+ _onFrameMouseOver() {
+ this.trigger('framePointerOver', {});
+ }
+
+ _onFrameMouseOut() {
+ this.trigger('framePointerOut', {});
+ }
+
_inject() {
let injectPromise = this._injectPromise;
if (injectPromise === null) {