Make sure we render border in split webviews

This commit is contained in:
Matt Bierner 2019-10-23 19:37:19 -07:00
parent da891e5264
commit af4ea4d46a
4 changed files with 4 additions and 4 deletions

View file

@ -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) {

View file

@ -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) {

View file

@ -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';

View file

@ -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';