mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 12:19:20 +00:00
Tweak WebviewPanelOnDidChangeViewStateEvent to only provide a webview panel
Expose a webview panel's view state as properties. Make WebviewPanelOnDidChangeViewStateEvent only fire an event with the webview who's state changed
This commit is contained in:
@@ -147,13 +147,13 @@ export class MarkdownPreviewManager implements vscode.WebviewPanelSerializer {
|
||||
}
|
||||
});
|
||||
|
||||
preview.onDidChangeViewState(({ active }) => {
|
||||
preview.onDidChangeViewState(({ webviewPanel }) => {
|
||||
disposeAll(this.previews.filter(otherPreview => preview !== otherPreview && preview!.matches(otherPreview)));
|
||||
|
||||
vscode.commands.executeCommand('setContext', MarkdownPreviewManager.markdownPreviewActiveContextKey,
|
||||
active);
|
||||
webviewPanel.visible);
|
||||
|
||||
this.activePreview = active ? preview : undefined;
|
||||
this.activePreview = webviewPanel.visible ? preview : undefined;
|
||||
});
|
||||
|
||||
return preview;
|
||||
|
||||
Reference in New Issue
Block a user