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

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

Issue 2409313003: [Devtools] Canvas network timeline experiment establishes scrolling (Closed)
Patch Set: Merge branch 'master' into NETWORK_TIMELINE_4_SCROLL Created 4 years, 2 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/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: third_party/WebKit/Source/devtools/front_end/ui_lazy/ViewportDataGrid.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui_lazy/ViewportDataGrid.js b/third_party/WebKit/Source/devtools/front_end/ui_lazy/ViewportDataGrid.js
index e21012f8209eb16598e53cae8f5486b813a61775..68d6b83be8ce8a61407da94806195f12787ec808 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui_lazy/ViewportDataGrid.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui_lazy/ViewportDataGrid.js
@@ -14,7 +14,11 @@
WebInspector.ViewportDataGrid = function(columnsArray, editCallback, deleteCallback, refreshCallback, contextMenuCallback)
{
WebInspector.DataGrid.call(this, columnsArray, editCallback, deleteCallback, refreshCallback, contextMenuCallback);
- this._scrollContainer.addEventListener("scroll", this._onScroll.bind(this), true);
+
+ this._onScrollBound = this._onScroll.bind(this);
+ this._scrollContainer.addEventListener("scroll", this._onScrollBound, true);
+
+ // This is not in setScrollContainer because mouse wheel needs to detect events on the content not the scrollbar itself.
this._scrollContainer.addEventListener("mousewheel", this._onWheel.bind(this), true);
/** @type {!Array.<!WebInspector.ViewportDataGridNode>} */
this._visibleNodes = [];
@@ -41,8 +45,22 @@ WebInspector.ViewportDataGrid = function(columnsArray, editCallback, deleteCallb
this.setRootNode(new WebInspector.ViewportDataGridNode());
}
+WebInspector.ViewportDataGrid.Events = {
+ ViewportCalculated: Symbol("ViewportCalculated")
+}
+
WebInspector.ViewportDataGrid.prototype = {
/**
+ * @param {!Element} scrollContainer
+ */
+ setScrollContainer: function(scrollContainer)
+ {
+ this._scrollContainer.removeEventListener("scroll", this._onScrollBound, true);
+ this._scrollContainer = scrollContainer;
+ this._scrollContainer.addEventListener("scroll", this._onScrollBound, true);
+ },
+
+ /**
* @override
*/
onResize: function()
@@ -246,6 +264,7 @@ WebInspector.ViewportDataGrid.prototype = {
this.updateWidths();
}
this._visibleNodes = visibleNodes;
+ this.dispatchEventToListeners(WebInspector.ViewportDataGrid.Events.ViewportCalculated);
},
/**
« no previous file with comments | « third_party/WebKit/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