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

Unified Diff: Source/devtools/front_end/ui/SoftContextMenu.js

Issue 669113002: DevTools: replace mouseout with mouseleave where possible. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: for landing Created 6 years, 2 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 | « Source/devtools/front_end/timeline/TimelineView.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ui/SoftContextMenu.js
diff --git a/Source/devtools/front_end/ui/SoftContextMenu.js b/Source/devtools/front_end/ui/SoftContextMenu.js
index 4336c00522819ec971703f608bde40b4da8119d9..15f25a604ad3d4e1039a587bad2b7a3225de7f22 100644
--- a/Source/devtools/front_end/ui/SoftContextMenu.js
+++ b/Source/devtools/front_end/ui/SoftContextMenu.js
@@ -44,6 +44,11 @@ WebInspector.SoftContextMenu.prototype = {
*/
show: function(document, x, y)
{
+ if (this._contextMenuElement)
+ this._discardMenu(true);
+ if (!this._items.length)
+ return;
+
this._document = document;
this._x = x;
this._y = y;
@@ -110,7 +115,7 @@ WebInspector.SoftContextMenu.prototype = {
// Manually manage hover highlight since :hover does not work in case of click-and-hold menu invocation.
menuItemElement.addEventListener("mouseover", this._menuItemMouseOver.bind(this), false);
- menuItemElement.addEventListener("mouseout", this._menuItemMouseOut.bind(this), false);
+ menuItemElement.addEventListener("mouseleave", this._menuItemMouseLeave.bind(this), false);
menuItemElement._actionId = item.id;
return menuItemElement;
@@ -136,7 +141,7 @@ WebInspector.SoftContextMenu.prototype = {
// Manually manage hover highlight since :hover does not work in case of click-and-hold menu invocation.
menuItemElement.addEventListener("mouseover", this._menuItemMouseOver.bind(this), false);
- menuItemElement.addEventListener("mouseout", this._menuItemMouseOut.bind(this), false);
+ menuItemElement.addEventListener("mouseleave", this._menuItemMouseLeave.bind(this), false);
return menuItemElement;
},
@@ -208,7 +213,7 @@ WebInspector.SoftContextMenu.prototype = {
this._highlightMenuItem(event.target);
},
- _menuItemMouseOut: function(event)
+ _menuItemMouseLeave: function(event)
{
if (!this._subMenu || !event.relatedTarget) {
this._highlightMenuItem(null);
@@ -216,7 +221,7 @@ WebInspector.SoftContextMenu.prototype = {
}
var relatedTarget = event.relatedTarget;
- if (this._contextMenuElement.isSelfOrAncestor(relatedTarget) || relatedTarget.classList.contains("soft-context-menu-glass-pane"))
+ if (relatedTarget.classList.contains("soft-context-menu-glass-pane"))
this._highlightMenuItem(null);
},
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineView.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698