Skip to content

Commit 144376f

Browse files
authored
emit FileBrowserModel.pathChanged signal (#50)
* emit pathChanged signal * remove redundant var * fix dependency * remove dependency
1 parent 5063f70 commit 144376f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/unfold.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import { ElementExt } from '@lumino/domutils';
88

99
import { PromiseDelegate, ReadonlyJSONObject } from '@lumino/coreutils';
1010

11+
import { Signal } from '@lumino/signaling';
12+
1113
import { DOMUtils, showErrorMessage } from '@jupyterlab/apputils';
1214

1315
import { JupyterFrontEnd } from '@jupyterlab/application';
@@ -18,7 +20,7 @@ import { DocumentRegistry } from '@jupyterlab/docregistry';
1820

1921
import { renameFile } from '@jupyterlab/docmanager';
2022

21-
import { PathExt } from '@jupyterlab/coreutils';
23+
import { PathExt, IChangedArgs } from '@jupyterlab/coreutils';
2224

2325
import {
2426
DirListing,
@@ -426,7 +428,16 @@ export class FilterFileTreeBrowserModel extends FilterFileBrowserModel {
426428
}
427429

428430
set path(value: string) {
431+
const pathChanged = this.pathChanged as Signal<this, IChangedArgs<string>>;
432+
const oldValue = this._path;
433+
429434
this._path = value;
435+
436+
pathChanged.emit({
437+
name: 'path',
438+
oldValue,
439+
newValue: value
440+
});
430441
}
431442

432443
/**

0 commit comments

Comments
 (0)