Commit 63ecc1db authored by dgozman@chromium.org's avatar dgozman@chromium.org

[DevTools] Hide popover on window resize.

Popover is a modal element, and should be hidden on resize,
toggling fullscreen, zoom change akin to TextPrompt.

BUG=388659

Review URL: https://codereview.chromium.org/353833003

git-svn-id: svn://svn.chromium.org/blink/trunk@177092 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 2117262f
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment