mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-01 22:12:26 +01:00
Move theme change logic into webview itself
This commit is contained in:
@@ -204,7 +204,6 @@ class WebviewEditor extends BaseWebviewEditor {
|
||||
enableWrappedPostMessage: true
|
||||
};
|
||||
this.webview.contents = input.html;
|
||||
this.webview.style(this.themeService.getTheme());
|
||||
}
|
||||
|
||||
private get webview(): Webview {
|
||||
@@ -214,6 +213,7 @@ class WebviewEditor extends BaseWebviewEditor {
|
||||
this._webview = new Webview(
|
||||
this.webviewContent,
|
||||
this._partService.getContainer(Parts.EDITOR_PART),
|
||||
this.themeService,
|
||||
this._environmentService,
|
||||
this._contextService,
|
||||
this._contextViewService,
|
||||
@@ -223,17 +223,9 @@ class WebviewEditor extends BaseWebviewEditor {
|
||||
enableWrappedPostMessage: true
|
||||
},
|
||||
false);
|
||||
this.webview.style(this.themeService.getTheme());
|
||||
|
||||
this._webview.onDidClickLink(this.onDidClickLink, this, this._contentDisposables);
|
||||
|
||||
|
||||
this.themeService.onThemeChange(theme => {
|
||||
if (this._webview) {
|
||||
this._webview.style(theme);
|
||||
}
|
||||
}, null, this._contentDisposables);
|
||||
|
||||
this._webview.onMessage(message => {
|
||||
if (this.input) {
|
||||
(this.input as WebviewInput).events.onMessage(message);
|
||||
|
||||
Reference in New Issue
Block a user