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

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

Issue 1183483011: DevTools: Support popover on timeline overview. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: index-based -> frame-based Created 5 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
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)
{
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);
« no previous file with comments | « Source/devtools/front_end/timeline/timelinePanel.css ('k') | Source/devtools/front_end/ui_lazy/OverviewGrid.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698