Chromium Code Reviews| 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..651129427409b801885d95c6db8b91e48d140b66 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 only should be bound to content and not another scroller. |
|
dgozman
2016/10/11 21:53:40
I don't get this.
allada
2016/10/12 00:33:09
Better?
|
| 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 = { |
| + Updated: Symbol("Updated") |
|
dgozman
2016/10/11 21:53:39
Not very descriptive name.
allada
2016/10/12 00:33:09
Done.
|
| +} |
| + |
| 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); |
|
dgozman
2016/10/11 21:53:39
Why capture?
allada
2016/10/12 00:33:09
It needs it for stick to bottom and a few other th
|
| + }, |
| + |
| + /** |
| * @override |
| */ |
| onResize: function() |
| @@ -246,6 +264,7 @@ WebInspector.ViewportDataGrid.prototype = { |
| this.updateWidths(); |
| } |
| this._visibleNodes = visibleNodes; |
| + this.dispatchEventToListeners(WebInspector.ViewportDataGrid.Events.Updated); |
| }, |
| /** |