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

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

Issue 663083004: [DevTools] Remove remaining usages of global properties. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed review comments 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/ui/ShortcutRegistry.js ('k') | Source/devtools/front_end/ui/StatusBarButton.js » ('j') | 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 28d589459a7d70a0940d662db8e4e09f91df4735..4336c00522819ec971703f608bde40b4da8119d9 100644
--- a/Source/devtools/front_end/ui/SoftContextMenu.js
+++ b/Source/devtools/front_end/ui/SoftContextMenu.js
@@ -38,11 +38,13 @@ WebInspector.SoftContextMenu = function(items, itemSelectedCallback, parentMenu)
WebInspector.SoftContextMenu.prototype = {
/**
+ * @param {!Document} document
* @param {number} x
* @param {number} y
*/
- show: function(x, y)
+ show: function(document, x, y)
{
+ this._document = document;
this._x = x;
this._y = y;
this._time = new Date().getTime();
@@ -190,7 +192,7 @@ WebInspector.SoftContextMenu.prototype = {
return;
this._subMenu = new WebInspector.SoftContextMenu(menuItemElement._subItems, this._itemSelectedCallback, this);
- this._subMenu.show(this._x + menuItemElement.offsetWidth - 3, this._y + menuItemElement.offsetTop - 1);
+ this._subMenu.show(this._document, this._x + menuItemElement.offsetWidth - 3, this._y + menuItemElement.offsetTop - 1);
},
_hideSubMenu: function()
@@ -315,7 +317,7 @@ WebInspector.SoftContextMenu.prototype = {
var glassPane = this._glassPaneElement;
delete this._glassPaneElement;
// This can re-enter discardMenu due to blur.
- document.body.removeChild(glassPane);
+ this._document.body.removeChild(glassPane);
if (this._parentMenu) {
delete this._parentMenu._subMenu;
if (closeParentMenus)
« no previous file with comments | « Source/devtools/front_end/ui/ShortcutRegistry.js ('k') | Source/devtools/front_end/ui/StatusBarButton.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698