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

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

Issue 440853002: DevTools: NetworkPanel: get rid of stripes gradient. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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/networkLogView.css ('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/ViewportDataGrid.js
diff --git a/Source/devtools/front_end/ui/ViewportDataGrid.js b/Source/devtools/front_end/ui/ViewportDataGrid.js
index 4c660c13932c55025cd4914eefe34c0d49e32701..07725bcb6073f9929b29dee215fc46f65d572490 100644
--- a/Source/devtools/front_end/ui/ViewportDataGrid.js
+++ b/Source/devtools/front_end/ui/ViewportDataGrid.js
@@ -83,13 +83,13 @@ WebInspector.ViewportDataGrid.prototype = {
/**
* @param {number} scrollHeight
* @param {number} scrollTop
- * @return {{topPadding: number, bottomPadding: number, visibleNodes: !Array.<!WebInspector.ViewportDataGridNode>}}
+ * @return {{topPadding: number, bottomPadding: number, visibleNodes: !Array.<!WebInspector.ViewportDataGridNode>, offset: number}}
*/
_calculateVisibleNodes: function(scrollHeight, scrollTop)
{
var nodes = this._rootNode.children;
if (this._inline)
- return {topPadding: 0, bottomPadding: 0, visibleNodes: nodes};
+ return {topPadding: 0, bottomPadding: 0, visibleNodes: nodes, offset: 0};
var size = nodes.length;
var i = 0;
@@ -108,7 +108,7 @@ WebInspector.ViewportDataGrid.prototype = {
for (; i < size; ++i)
bottomPadding += nodes[i].nodeSelfHeight();
- return {topPadding: topPadding, bottomPadding: bottomPadding, visibleNodes: nodes.slice(start, end)};
+ return {topPadding: topPadding, bottomPadding: bottomPadding, visibleNodes: nodes.slice(start, end), offset: start};
},
_update: function()
@@ -140,8 +140,10 @@ WebInspector.ViewportDataGrid.prototype = {
if (previousElement.nextSibling === this._hiddenWheelTarget)
previousElement = this._hiddenWheelTarget;
var tBody = this.dataTableBody;
+ var offset = viewportState.offset;
for (var i = 0; i < visibleNodes.length; ++i) {
var element = visibleNodes[i].element();
+ element.classList.toggle("odd", (offset + i) % 2 === 0);
tBody.insertBefore(element, previousElement.nextSibling);
previousElement = element;
}
« no previous file with comments | « Source/devtools/front_end/networkLogView.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698