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

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

Issue 353833003: [DevTools] Hide popover on window resize. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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: Source/devtools/front_end/ui/Popover.js
diff --git a/Source/devtools/front_end/ui/Popover.js b/Source/devtools/front_end/ui/Popover.js
index 07a0abf191b2eac6e068d8b039f8450c2a0ce1e0..e03223a21d8d724b997af8df6a3934da058b0585 100644
--- a/Source/devtools/front_end/ui/Popover.js
+++ b/Source/devtools/front_end/ui/Popover.js
@@ -49,6 +49,7 @@ WebInspector.Popover = function(popoverHelper)
this.element.appendChild(this._contentDiv);
this._popoverHelper = popoverHelper;
+ this._hideBound = this.hide.bind(this);
}
WebInspector.Popover.prototype = {
@@ -99,6 +100,7 @@ WebInspector.Popover.prototype = {
preferredWidth = preferredWidth || preferredSize.width;
preferredHeight = preferredHeight || preferredSize.height;
+ window.addEventListener("resize", this._hideBound, false);
document.body.appendChild(this._containerElement);
WebInspector.View.prototype.show.call(this, this._containerElement);
@@ -117,6 +119,7 @@ WebInspector.Popover.prototype = {
hide: function()
{
+ window.removeEventListener("resize", this._hideBound, false);
this.detach();
this._containerElement.remove();
delete WebInspector.Popover._popover;
« 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