Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(613)

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/Popover.js

Issue 2770683003: [DevTools] Fix Popover click handling. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/ui/Popover.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Popover.js b/third_party/WebKit/Source/devtools/front_end/ui/Popover.js
index e96c3d01c349dbf3a4d96e9adb78ef9ef62f66ec..4d6ec06c20cc61e03b96bb6f3c4201e7bdb2def5 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/Popover.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/Popover.js
@@ -87,13 +87,16 @@ UI.PopoverHelper = class {
* @param {!Event} event
*/
_mouseDown(event) {
- if (this._disableOnClick || !this._eventInScheduledContent(event)) {
+ if (this._disableOnClick) {
this.hidePopover();
- } else {
- this._stopHidePopoverTimer();
- this._stopShowPopoverTimer();
- this._startShowPopoverTimer(event, 0);
+ return;
}
+ if (this._eventInScheduledContent(event))
+ return;
+
+ this._startHidePopoverTimer(0);
+ this._stopShowPopoverTimer();
+ this._startShowPopoverTimer(event, 0);
}
/**
@@ -104,7 +107,7 @@ UI.PopoverHelper = class {
if (this._eventInScheduledContent(event))
return;
- this._startHidePopoverTimer();
+ this._startHidePopoverTimer(this._hideTimeout);
this._stopShowPopoverTimer();
if (event.which && this._disableOnClick)
return;
@@ -127,7 +130,7 @@ UI.PopoverHelper = class {
if (!popover.isShowing())
return;
if (event.relatedTarget && !event.relatedTarget.isSelfOrDescendant(popover.contentElement))
- this._startHidePopoverTimer();
+ this._startHidePopoverTimer(this._hideTimeout);
}
/**
@@ -137,18 +140,21 @@ UI.PopoverHelper = class {
if (!this.isPopoverVisible())
return;
if (!this._eventInScheduledContent(event))
- this._startHidePopoverTimer();
+ this._startHidePopoverTimer(this._hideTimeout);
}
- _startHidePopoverTimer() {
- // User has this._hideTimeout to reach the popup.
+ /**
+ * @param {number} timeout
+ */
+ _startHidePopoverTimer(timeout) {
+ // User has |timeout| ms to reach the popup.
if (!this._hidePopoverCallback || this._hidePopoverTimer)
return;
this._hidePopoverTimer = setTimeout(() => {
this._hidePopover();
delete this._hidePopoverTimer;
- }, this._hideTimeout);
+ }, timeout);
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698