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

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

Issue 468043004: DevTools: keyboard navigation broken in the viewported Network panel (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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 | « no previous file | 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 593ac15693060187624526837a90ab4270f285d6..09018bb759f3682af12eb175190ac0adb093f296 100644
--- a/Source/devtools/front_end/ui/ViewportDataGrid.js
+++ b/Source/devtools/front_end/ui/ViewportDataGrid.js
@@ -44,7 +44,8 @@ WebInspector.ViewportDataGrid.prototype = {
/**
* @protected
*/
- scheduleUpdate: function() {
+ scheduleUpdate: function()
+ {
if (this._updateScheduled)
return;
this._updateScheduled = true;
@@ -120,6 +121,28 @@ WebInspector.ViewportDataGrid.prototype = {
this._visibleNodes = visibleNodes;
},
+ /**
+ * @param {!WebInspector.ViewportDataGridNode} node
+ */
+ _revealViewportNode: function(node)
+ {
+ var nodes = this._rootNode.children;
+ var index = nodes.indexOf(node);
+ if (index === -1)
+ return;
+ var fromY = 0;
+ for (var i = 0; i < index; ++i)
+ fromY += nodes[i].nodeSelfHeight();
+ var toY = fromY + node.nodeSelfHeight();
+
+ var scrollTop = this._scrollContainer.scrollTop;
+ if (scrollTop > fromY)
lushnikov 2014/08/13 19:50:25 if (this._visibleNodes.indexOf(node) !== -1) ret
+ scrollTop = fromY;
+ else if (scrollTop + this._scrollContainer.offsetHeight < toY)
+ scrollTop = toY - this._scrollContainer.offsetHeight;
+ this._scrollContainer.scrollTop = scrollTop;
+ },
+
__proto__: WebInspector.DataGrid.prototype
}
@@ -163,6 +186,7 @@ WebInspector.ViewportDataGridNode.prototype = {
*/
insertChild: function(child, index)
{
+ child.parent = this;
child.dataGrid = this.dataGrid;
this.children.splice(index, 0, child);
child.recalculateSiblings(index);
@@ -218,5 +242,11 @@ WebInspector.ViewportDataGridNode.prototype = {
}
},
+ reveal: function()
+ {
+ this.dataGrid._revealViewportNode(this);
+ WebInspector.DataGridNode.prototype.reveal.call(this);
+ },
+
__proto__: WebInspector.DataGridNode.prototype
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698