提交 af4ea4d4 编写于 作者: M Matt Bierner

Make sure we render border in split webviews

上级 da891e52
......@@ -180,7 +180,7 @@ export class CustomEditorService extends Disposable implements ICustomEditorServ
): CustomFileEditorInput {
const id = generateUuid();
const webview = new Lazy(() => {
return new UnownedDisposable(this.webviewService.createWebviewEditorOverlay(id, { customClasses: options ? options.customClasses : undefined }, {}));
return new UnownedDisposable(this.webviewService.createWebviewEditorOverlay(id, { customClasses: options?.customClasses }, {}));
});
const input = this.instantiationService.createInstance(CustomFileEditorInput, resource, viewType, id, webview);
if (group) {
......
......@@ -143,7 +143,7 @@ export class DynamicWebviewEditorOverlay extends Disposable implements WebviewEd
}
public get options(): WebviewOptions { return this._options; }
public set options(value: WebviewOptions) { this._options = value; }
public set options(value: WebviewOptions) { this._options = { customClasses: this._options.customClasses, ...value }; }
public get contentOptions(): WebviewContentOptions { return this._contentOptions; }
public set contentOptions(value: WebviewContentOptions) {
......
......@@ -60,7 +60,7 @@ export class IFrameWebview extends BaseWebview<HTMLIFrameElement> implements Web
protected createElement(options: WebviewOptions) {
const element = document.createElement('iframe');
element.className = `webview ${options.customClasses}`;
element.className = `webview ${options.customClasses || ''}`;
element.sandbox.add('allow-scripts', 'allow-same-origin');
element.setAttribute('src', `${this.externalEndpoint}/index.html?id=${this.id}`);
element.style.border = 'none';
......
......@@ -296,7 +296,7 @@ export class ElectronWebviewBasedWebview extends BaseWebview<WebviewTag> impleme
const element = document.createElement('webview');
element.setAttribute('partition', `webview${Date.now()}`);
element.setAttribute('webpreferences', 'contextIsolation=yes');
element.className = `webview ${options.customClasses}`;
element.className = `webview ${options.customClasses || ''}`;
element.style.flex = '0 1';
element.style.width = '0';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册