Chromium Code Reviews| 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 7076551ca100cd4b996a7c69d77ac24a717a5eb4..5822b9b30adba4327f3b5f7205b1fd4c815a920c 100644 |
| --- a/Source/devtools/front_end/ui/Popover.js |
| +++ b/Source/devtools/front_end/ui/Popover.js |
| @@ -97,8 +97,8 @@ WebInspector.Popover.prototype = { |
| // Temporarily attach in order to measure preferred dimensions. |
| var preferredSize = view ? view.measurePreferredSize() : WebInspector.measurePreferredSize(this._contentElement); |
| - preferredWidth = preferredWidth || preferredSize.width; |
| - preferredHeight = preferredHeight || preferredSize.height; |
| + this._preferredWidth = preferredWidth || preferredSize.width; |
| + this._preferredHeight = preferredHeight || preferredSize.height; |
| window.addEventListener("resize", this._hideBound, false); |
| document.body.appendChild(this._containerElement); |
| @@ -109,7 +109,7 @@ WebInspector.Popover.prototype = { |
| else |
| this._contentDiv.appendChild(this._contentElement); |
| - this._positionElement(anchor, preferredWidth, preferredHeight, arrowDirection); |
| + this.positionElement(anchor, this._preferredWidth, this._preferredHeight, arrowDirection); |
| if (this._popoverHelper) { |
| this._contentDiv.addEventListener("mousemove", this._popoverHelper._killHidePopoverTimer.bind(this._popoverHelper), true); |
| @@ -157,11 +157,11 @@ WebInspector.Popover.prototype = { |
| /** |
| * @param {!Element|!AnchorBox} anchorElement |
| - * @param {number} preferredWidth |
| - * @param {number} preferredHeight |
| + * @param {number=} preferredWidth |
| + * @param {number=} preferredHeight |
| * @param {?WebInspector.Popover.Orientation=} arrowDirection |
| */ |
| - _positionElement: function(anchorElement, preferredWidth, preferredHeight, arrowDirection) |
| + positionElement: function(anchorElement, preferredWidth, preferredHeight, arrowDirection) |
|
caseq
2015/06/16 14:14:49
Exposing this does not seem to be a good style. Ca
alph
2015/06/17 09:17:08
Could you elaborate. Do you mean make it auto repo
|
| { |
| const borderWidth = this._hasNoMargins ? 0 : 8; |
| const scrollerWidth = this._hasFixedHeight ? 0 : 11; |
| @@ -169,6 +169,8 @@ WebInspector.Popover.prototype = { |
| const arrowOffset = 10; |
| const borderRadius = 4; |
| const arrowRadius = 6; |
| + preferredWidth = preferredWidth || this._preferredWidth; |
| + preferredHeight = preferredHeight || this._preferredHeight; |
| // Skinny tooltips are not pretty, their arrow location is not nice. |
| preferredWidth = Math.max(preferredWidth, 50); |