Unify getTrackShellButtons and getContextMenu.
There is no need to have both and current approach has limitations:
e.g. context menu is always going to be the last button, and not
being able to add more buttons with context menus.
Allow getTrackShellButtons to return any mithril vnode instead of
requiring TrackButtonAttrs and fold getContextMenu into it.
Change-Id: Ib8337260b44d3b4928574a2b6c63eee86f75c026
diff --git a/ui/src/common/basic_async_track.ts b/ui/src/common/basic_async_track.ts
index 2faf829..2f62dc6 100644
--- a/ui/src/common/basic_async_track.ts
+++ b/ui/src/common/basic_async_track.ts
@@ -19,7 +19,6 @@
import {globals} from '../frontend/globals';
import {PxSpan, TimeScale} from '../frontend/time_scale';
import {SliceRect} from '../frontend/track';
-import {TrackButtonAttrs} from '../frontend/track_panel';
import {Track} from '../public';
import {TrackData} from './track_data';
@@ -67,14 +66,10 @@
abstract getHeight(): number;
- getTrackShellButtons(): m.Vnode<TrackButtonAttrs, {}>[] {
+ getTrackShellButtons(): m.Children {
return [];
}
- getContextMenu(): m.Vnode<any, {}>|null {
- return null;
- }
-
onMouseMove(_position: {x: number; y: number;}): void {}
onMouseClick(_position: {x: number; y: number;}): boolean {