Skip to content

Commit

Permalink
feat: collapse the folderTree
Browse files Browse the repository at this point in the history
  • Loading branch information
wewoor committed Sep 24, 2021
1 parent f5a01bd commit 38d16d6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/extensions/explorer/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
import molecule from 'mo';
import { COLLAPSE_FOLDER_COMMAND_ID, SAMPLE_FOLDER_PANEL_ID } from 'mo/model';
import { IExtension } from 'mo/model/extension';

export const ExtendsExplorer: IExtension = {
activate() {
molecule.explorer.onRemovePanel((panel) => {
molecule.explorer.removePanel(panel.id);
});

// Implements to collapse the expanded tree nodes
molecule.explorer.onPanelToolbarClick((panel, actionId) => {
if (
panel.id === SAMPLE_FOLDER_PANEL_ID &&
actionId === COLLAPSE_FOLDER_COMMAND_ID
) {
molecule.folderTree.setExpandedKeys([]);
}
});
},
};

0 comments on commit 38d16d6

Please sign in to comment.