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

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

Issue 2598873002: DevTools: Make sure network and main flamechart scales are in sync. (Closed)
Patch Set: addressing comment Created 4 years 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
Index: third_party/WebKit/Source/devtools/front_end/ui_lazy/ChartViewport.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui_lazy/ChartViewport.js b/third_party/WebKit/Source/devtools/front_end/ui_lazy/ChartViewport.js
index 10413d1d8024a2ab83ceaefd7ee160b3c7620975..32ee51c15af8c7e91a7a07f7f34199713a697585 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui_lazy/ChartViewport.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui_lazy/ChartViewport.js
@@ -19,6 +19,7 @@ UI.ChartViewport = class extends UI.VBox {
this.viewportElement, this._startRangeSelection.bind(this), this._rangeSelectionDragging.bind(this),
this._endRangeSelection.bind(this), 'text', null);
+ this._alwaysShowVerticalScroll = false;
this._vScrollElement = this.contentElement.createChild('div', 'flame-chart-v-scroll');
this._vScrollContent = this._vScrollElement.createChild('div');
this._vScrollElement.addEventListener('scroll', this._onScroll.bind(this), false);
@@ -29,6 +30,11 @@ UI.ChartViewport = class extends UI.VBox {
this.reset();
}
+ alwaysShowVerticalScroll() {
+ this._alwaysShowVerticalScroll = true;
+ this._vScrollElement.classList.add('always-show-scrollbar');
+ }
+
/**
* @return {boolean}
*/
@@ -48,7 +54,7 @@ UI.ChartViewport = class extends UI.VBox {
* @private
*/
_updateScrollBar() {
- var showScroll = this._totalHeight > this._offsetHeight;
+ const showScroll = this._alwaysShowVerticalScroll || this._totalHeight > this._offsetHeight;
if (this._vScrollElement.classList.contains('hidden') !== showScroll)
return;
this._vScrollElement.classList.toggle('hidden', !showScroll);

Powered by Google App Engine
This is Rietveld 408576698