-
Notifications
You must be signed in to change notification settings - Fork 120
/
layout.ts
29 lines (23 loc) · 954 Bytes
/
layout.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import 'reflect-metadata';
import { container, singleton } from 'tsyringe';
import { Controller } from 'mo/react/controller';
import { ILayoutService, LayoutService } from 'mo/services';
export interface ILayoutController extends Partial<Controller> {
onPaneSizeChange?: (splitPanePos: number[]) => void;
onHorizontalPaneSizeChange?: (horizontalSplitPanePos: number[]) => void;
}
@singleton()
export class LayoutController extends Controller implements ILayoutController {
private readonly layoutService: ILayoutService;
constructor() {
super();
this.layoutService = container.resolve(LayoutService);
}
public initView() {}
public onPaneSizeChange = (splitPanePos: number[]) => {
this.layoutService.setPaneSize(splitPanePos);
};
public onHorizontalPaneSizeChange = (horizontalSplitPanePos: number[]) => {
this.layoutService.setHorizontalPaneSize(horizontalSplitPanePos);
};
}