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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui_lazy/FlameChart.js

Issue 2314173003: Timeline: make prepareHighlightedEntryInfo return ?Promise<!Element> (Closed)
Patch Set: Timeline: make prepareHighlightEntryInfo return ?Element Created 4 years, 3 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 | « third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChart.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/ui_lazy/FlameChart.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui_lazy/FlameChart.js b/third_party/WebKit/Source/devtools/front_end/ui_lazy/FlameChart.js
index 3355cc77f925ffa7be4dcfdc373b4a124ea060eb..2bb41eb4857417cf3c534139d7b9e0eaeeed8cc6 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui_lazy/FlameChart.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui_lazy/FlameChart.js
@@ -215,7 +215,7 @@ WebInspector.FlameChartDataProvider.prototype = {
/**
* @param {number} entryIndex
- * @return {?Array.<!{title: string, value: (string|!Element)}>}
+ * @return {?Element}
*/
prepareHighlightedEntryInfo: function(entryIndex) { },
@@ -813,12 +813,20 @@ WebInspector.FlameChart.prototype = {
*/
_updatePopover: function(entryIndex)
{
- if (entryIndex !== this._highlightedEntryIndex) {
- this._entryInfo.removeChildren();
- var entryInfo = this._dataProvider.prepareHighlightedEntryInfo(entryIndex);
- if (entryInfo)
- this._entryInfo.appendChild(this._buildEntryInfo(entryInfo));
+ if (entryIndex === this._highlightedEntryIndex) {
alph 2016/09/08 01:37:46 You can revert this change.
+ this._updatePopoverOffset();
+ return;
+ }
+ this._entryInfo.removeChildren();
+ var popoverElement = this._dataProvider.prepareHighlightedEntryInfo(entryIndex);
+ if (popoverElement) {
+ this._entryInfo.appendChild(popoverElement);
+ this._updatePopoverOffset();
}
+ },
+
+ _updatePopoverOffset: function()
+ {
var mouseX = this._lastMouseOffsetX;
var mouseY = this._lastMouseOffsetY;
var parentWidth = this._entryInfo.parentElement.clientWidth;
@@ -1842,24 +1850,6 @@ WebInspector.FlameChart.prototype = {
},
/**
- * @param {!Array<!{title: string, value: (string|!Element)}>} entryInfo
- * @return {!Element}
- */
- _buildEntryInfo: function(entryInfo)
- {
- var infoTable = createElementWithClass("table", "info-table");
- for (var entry of entryInfo) {
- var row = infoTable.createChild("tr");
- row.createChild("td", "title").textContent = entry.title;
- if (typeof entry.value === "string")
- row.createChild("td").textContent = entry.value;
- else
- row.createChild("td").appendChild(entry.value);
- }
- return infoTable;
- },
-
- /**
* @param {!CanvasRenderingContext2D} context
* @param {string} text
* @param {number} maxWidth
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChart.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698