Make sure we render border in split webviews
This commit is contained in:
parent
da891e5264
commit
af4ea4d46a
4 changed files with 4 additions and 4 deletions
|
@ -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';
|
||||
|
|
Loading…
Reference in a new issue