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

Unified Diff: Source/devtools/front_end/ui_lazy/ViewportDataGrid.js

Issue 1309603002: DevTools: [timeline tree view] edge of datagrid cut off (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 | « Source/devtools/front_end/ui_lazy/DataGrid.js ('k') | 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_lazy/ViewportDataGrid.js
diff --git a/Source/devtools/front_end/ui_lazy/ViewportDataGrid.js b/Source/devtools/front_end/ui_lazy/ViewportDataGrid.js
index ac840258c2019c8a0bbe131890b84b3b56877383..259bd00ce9fc3fcc4f7ffd54ea365fc3506cfd7a 100644
--- a/Source/devtools/front_end/ui_lazy/ViewportDataGrid.js
+++ b/Source/devtools/front_end/ui_lazy/ViewportDataGrid.js
@@ -143,13 +143,13 @@ WebInspector.ViewportDataGrid.prototype = {
/**
* @param {number} clientHeight
* @param {number} scrollTop
- * @return {{topPadding: number, bottomPadding: number, visibleNodes: !Array.<!WebInspector.ViewportDataGridNode>, offset: number}}
+ * @return {{topPadding: number, bottomPadding: number, contentHeight: number, visibleNodes: !Array.<!WebInspector.ViewportDataGridNode>, offset: number}}
*/
_calculateVisibleNodes: function(clientHeight, scrollTop)
{
var nodes = this._flatNodesList();
if (this._inline)
- return {topPadding: 0, bottomPadding: 0, visibleNodes: nodes, offset: 0};
+ return {topPadding: 0, bottomPadding: 0, contentHeight: 0, visibleNodes: nodes, offset: 0};
var size = nodes.length;
var i = 0;
@@ -168,7 +168,7 @@ WebInspector.ViewportDataGrid.prototype = {
for (; i < size; ++i)
bottomPadding += nodes[i].nodeSelfHeight();
- return {topPadding: topPadding, bottomPadding: bottomPadding, visibleNodes: nodes.slice(start, end), offset: start};
+ return {topPadding: topPadding, bottomPadding: bottomPadding, contentHeight: y - topPadding, visibleNodes: nodes.slice(start, end), offset: start};
},
/**
@@ -232,6 +232,8 @@ WebInspector.ViewportDataGrid.prototype = {
}
this.setVerticalPadding(viewportState.topPadding, viewportState.bottomPadding);
+ var contentFits = viewportState.contentHeight <= clientHeight;
+ this.element.classList.toggle("data-grid-fits-viewport", contentFits && viewportState.topPadding + viewportState.bottomPadding === 0);
this._lastScrollTop = scrollTop;
if (scrollTop !== currentScrollTop)
this._scrollContainer.scrollTop = scrollTop;
« no previous file with comments | « Source/devtools/front_end/ui_lazy/DataGrid.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698