Kaynağa Gözat

Move temporary `SplitPanel` to its own file.

Afshin Darian 7 yıl önce
ebeveyn
işleme
e2db9fba20

+ 1 - 1
packages/settingeditor-extension/src/raweditor.ts

@@ -23,7 +23,7 @@ import {
 
 import {
   SplitPanel
-} from './settingeditor';
+} from './splitpanel';
 
 
 /**

+ 33 - 0
packages/settingeditor-extension/src/splitpanel.ts

@@ -0,0 +1,33 @@
+/*-----------------------------------------------------------------------------
+| 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.
+ */
+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(void 0);
+    }
+  }
+}