forked from jupyterlab/jupyterlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
splitpanel.ts
27 lines (22 loc) · 904 Bytes
/
splitpanel.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
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
import { SplitPanel as SPanel } from '@phosphor/widgets';
import { ISignal, Signal } from '@phosphor/signaling';
/**
* A deprecated split panel that will be removed when the phosphor split panel
* supports a handle moved signal. See https://github.com/phosphorjs/phosphor/issues/297.
*/
export class SplitPanel extends SPanel {
/**
* Emits when the split handle has moved.
*/
readonly handleMoved: ISignal<any, void> = new Signal<any, void>(this);
handleEvent(event: Event): void {
super.handleEvent(event);
if (event.type === 'mouseup') {
(this.handleMoved as Signal<any, void>).emit(undefined);
}
}
}