Edit book using drag and drop (#16906)

- Use the onDrop method for moving notebooks/sections in the Notebooks Tree View.
- Allow multi selection in tree view
- Modify notebook commands to only show when a single tree item is selected.
This commit is contained in:
Barbara Valdez
2021-09-02 11:07:03 -07:00
committed by GitHub
parent 3803809223
commit bb3ccb92a4
6 changed files with 133 additions and 82 deletions

View File

@@ -62,8 +62,9 @@ export async function activate(extensionContext: vscode.ExtensionContext): Promi
await pinnedBookTreeViewProvider.removeNotebookFromPinnedView(book);
}));
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.moveTo', async (book: BookTreeItem) => {
await bookTreeViewProvider.editBook(book);
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.moveTo', async (firstTreeItem: BookTreeItem, treeItems?: BookTreeItem[]) => {
let allTreeItems = treeItems ? [firstTreeItem, ...treeItems] : [firstTreeItem];
await bookTreeViewProvider.moveTreeItems(allTreeItems);
}));
let model = new RemoteBookDialogModel();