Merge "Don't render overview panel when window is too small."
diff --git a/ui/src/frontend/overview_timeline_panel.ts b/ui/src/frontend/overview_timeline_panel.ts
index dc8a45d..fbc275f 100644
--- a/ui/src/frontend/overview_timeline_panel.ts
+++ b/ui/src/frontend/overview_timeline_panel.ts
@@ -52,14 +52,18 @@
this.width = dom.getBoundingClientRect().width;
this.traceTime = globals.stateTraceTimeTP();
const traceTime = globals.stateTraceTime();
- const pxSpan = new PxSpan(TRACK_SHELL_WIDTH, this.width);
- this.timeScale = TimeScale.fromHPTimeSpan(traceTime, pxSpan);
- if (this.gesture === undefined) {
- this.gesture = new DragGestureHandler(
- dom as HTMLElement,
- this.onDrag.bind(this),
- this.onDragStart.bind(this),
- this.onDragEnd.bind(this));
+ if (this.width > TRACK_SHELL_WIDTH) {
+ const pxSpan = new PxSpan(TRACK_SHELL_WIDTH, this.width);
+ this.timeScale = TimeScale.fromHPTimeSpan(traceTime, pxSpan);
+ if (this.gesture === undefined) {
+ this.gesture = new DragGestureHandler(
+ dom as HTMLElement,
+ this.onDrag.bind(this),
+ this.onDragStart.bind(this),
+ this.onDragEnd.bind(this));
+ }
+ } else {
+ this.timeScale = undefined;
}
}