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

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

Issue 449413002: DevTools: DataGrid: turn "element" getter to function. (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/profiler/HeapSnapshotDataGrids.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/DataGrid.js
diff --git a/Source/devtools/front_end/ui/DataGrid.js b/Source/devtools/front_end/ui/DataGrid.js
index 3c40fce0f3159cbc9bd64812de6f9aad9575e01b..a0f9561e26875180bdf3bfc929811324d4d37d1e 100644
--- a/Source/devtools/front_end/ui/DataGrid.js
+++ b/Source/devtools/front_end/ui/DataGrid.js
@@ -1128,14 +1128,14 @@ WebInspector.DataGridNode.prototype = {
/** @type {boolean} */
_isRoot: false,
- get element()
+ /**
+ * @return {!Element}
+ */
+ element: function()
{
if (this._element)
return this._element;
- if (!this.dataGrid)
- return null;
-
this._element = document.createElement("tr");
this._element._dataGridNode = this;
@@ -1550,7 +1550,7 @@ WebInspector.DataGridNode.prototype = {
currentAncestor = currentAncestor.parent;
}
- this.element.scrollIntoViewIfNeeded(false);
+ this.element().scrollIntoViewIfNeeded(false);
},
/**
@@ -1692,8 +1692,8 @@ WebInspector.DataGridNode.prototype = {
var nextNode = null;
var previousNode = this.traversePreviousNode(true, true);
- var previousElement = previousNode ? previousNode.element : this.dataGrid._topFillerRow;
- this.dataGrid.dataTableBody.insertBefore(this.element, previousElement.nextSibling);
+ var previousElement = previousNode ? previousNode.element() : this.dataGrid._topFillerRow;
+ this.dataGrid.dataTableBody.insertBefore(this.element(), previousElement.nextSibling);
if (this.expanded)
for (var i = 0; i < this.children.length; ++i)
« no previous file with comments | « Source/devtools/front_end/profiler/HeapSnapshotDataGrids.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698