Skip to content

Commit

Permalink
emit FileBrowserModel.pathChanged signal (#50)
Browse files Browse the repository at this point in the history
* emit pathChanged signal

* remove redundant var

* fix dependency

* remove dependency
  • Loading branch information
michaelchia authored May 28, 2024
1 parent 5063f70 commit 144376f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/unfold.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { ElementExt } from '@lumino/domutils';

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

import { Signal } from '@lumino/signaling';

import { DOMUtils, showErrorMessage } from '@jupyterlab/apputils';

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

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

import { PathExt } from '@jupyterlab/coreutils';
import { PathExt, IChangedArgs } from '@jupyterlab/coreutils';

import {
DirListing,
Expand Down Expand Up @@ -426,7 +428,16 @@ export class FilterFileTreeBrowserModel extends FilterFileBrowserModel {
}

set path(value: string) {
const pathChanged = this.pathChanged as Signal<this, IChangedArgs<string>>;
const oldValue = this._path;

this._path = value;

pathChanged.emit({
name: 'path',
oldValue,
newValue: value
});
}

/**
Expand Down

0 comments on commit 144376f

Please sign in to comment.