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

Unified Diff: Source/devtools/front_end/ui/SuggestBox.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/StatusBarButton.js ('k') | Source/devtools/front_end/ui/TextPrompt.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ui/SuggestBox.js
diff --git a/Source/devtools/front_end/ui/SuggestBox.js b/Source/devtools/front_end/ui/SuggestBox.js
index 51eab53043c54b835215b5713fc315577e3e990c..cbc75e668e0299af3f98d99c82da5f46509eda2e 100644
--- a/Source/devtools/front_end/ui/SuggestBox.js
+++ b/Source/devtools/front_end/ui/SuggestBox.js
@@ -60,7 +60,6 @@ WebInspector.SuggestBox = function(suggestBoxDelegate, maxItemsHeight)
this._selectedIndex = -1;
this._selectedElement = null;
this._maxItemsHeight = maxItemsHeight;
- this._bodyElement = document.body;
this._maybeHideBound = this._maybeHide.bind(this);
this._element = createElementWithClass("div", "suggest-box");
this._element.addEventListener("mousedown", this._onBoxMouseDown.bind(this), true);
@@ -138,11 +137,17 @@ WebInspector.SuggestBox.prototype = {
this._hideTimeoutId = window.setTimeout(this.hide.bind(this), 0);
},
+ /**
+ * @private // FIXME: this is a workaround for validator bug (http://crbug.com/425506).
+ * // FIXME: make SuggestBox work for multiple documents.
+ * @suppressGlobalPropertiesCheck
+ */
_show: function()
{
if (this.visible())
return;
this._overlay = new WebInspector.SuggestBox.Overlay();
+ this._bodyElement = document.body;
this._bodyElement.addEventListener("mousedown", this._maybeHideBound, true);
this._leftSpacerElement = this._overlay.element.createChild("div", "suggest-box-left-spacer");
@@ -158,6 +163,7 @@ WebInspector.SuggestBox.prototype = {
return;
this._bodyElement.removeEventListener("mousedown", this._maybeHideBound, true);
+ delete this._bodyElement;
this._element.remove();
this._overlay.dispose();
delete this._overlay;
@@ -410,6 +416,8 @@ WebInspector.SuggestBox.prototype = {
/**
* @constructor
+ * // FIXME: make SuggestBox work for multiple documents.
+ * @suppressGlobalPropertiesCheck
*/
WebInspector.SuggestBox.Overlay = function()
{
« no previous file with comments | « Source/devtools/front_end/ui/StatusBarButton.js ('k') | Source/devtools/front_end/ui/TextPrompt.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698