提交 76da7baa 编写于 作者: M Matt Bierner

_private

上级 8bb27cd2
......@@ -24,9 +24,9 @@ export class WebviewEditor extends BaseWebviewEditor {
public static readonly ID = 'WebviewEditor';
private editorFrame: HTMLElement;
private content: HTMLElement;
private webviewContent: HTMLElement | undefined;
private _editorFrame: HTMLElement;
private _content: HTMLElement;
private _webviewContent: HTMLElement | undefined;
private _webviewFocusTracker?: DOM.IFocusTracker;
private _webviewFocusListenerDisposable?: IDisposable;
......@@ -45,15 +45,15 @@ export class WebviewEditor extends BaseWebviewEditor {
}
protected createEditor(parent: HTMLElement): void {
this.editorFrame = parent;
this.content = document.createElement('div');
parent.appendChild(this.content);
this._editorFrame = parent;
this._content = document.createElement('div');
parent.appendChild(this._content);
}
private doUpdateContainer() {
const webviewContainer = this.input && (this.input as WebviewEditorInput).container;
if (webviewContainer && webviewContainer.parentElement) {
const frameRect = this.editorFrame.getBoundingClientRect();
const frameRect = this._editorFrame.getBoundingClientRect();
const containerRect = webviewContainer.parentElement.getBoundingClientRect();
webviewContainer.style.position = 'absolute';
......@@ -74,7 +74,7 @@ export class WebviewEditor extends BaseWebviewEditor {
public dispose(): void {
// Let the editor input dispose of the webview.
this._webview = undefined;
this.webviewContent = undefined;
this._webviewContent = undefined;
this._onDidFocusWebview.dispose();
......@@ -110,12 +110,12 @@ export class WebviewEditor extends BaseWebviewEditor {
this.updateWebview(this.input as WebviewEditorInput);
}
if (this.webviewContent) {
if (this._webviewContent) {
if (visible) {
this.webviewContent.style.visibility = 'visible';
this._webviewContent.style.visibility = 'visible';
this.doUpdateContainer();
} else {
this.webviewContent.style.visibility = 'hidden';
this._webviewContent.style.visibility = 'hidden';
}
}
......@@ -128,7 +128,7 @@ export class WebviewEditor extends BaseWebviewEditor {
}
this._webview = undefined;
this.webviewContent = undefined;
this._webviewContent = undefined;
super.clearInput();
}
......@@ -141,7 +141,7 @@ export class WebviewEditor extends BaseWebviewEditor {
if (this.input) {
(this.input as WebviewEditorInput).releaseWebview(this);
this._webview = undefined;
this.webviewContent = undefined;
this._webviewContent = undefined;
}
await super.setInput(input, options);
......@@ -162,8 +162,8 @@ export class WebviewEditor extends BaseWebviewEditor {
};
input.html = input.html;
if (this.webviewContent) {
this.webviewContent.style.visibility = 'visible';
if (this._webviewContent) {
this._webviewContent.style.visibility = 'visible';
}
this.doUpdateContainer();
......@@ -182,7 +182,7 @@ export class WebviewEditor extends BaseWebviewEditor {
return this._webview;
}
this.webviewContent = input.container;
this._webviewContent = input.container;
this.trackFocus();
......@@ -193,7 +193,7 @@ export class WebviewEditor extends BaseWebviewEditor {
}
if (input.options.enableFindWidget) {
this._contextKeyService = this._contextKeyService.createScoped(this.webviewContent);
this._contextKeyService = this._contextKeyService.createScoped(this._webviewContent);
this.contextKey = KEYBINDING_CONTEXT_WEBVIEWEDITOR_FOCUS.bindTo(this._contextKeyService);
this.findInputFocusContextKey = KEYBINDING_CONTEXT_WEBVIEWEDITOR_FIND_WIDGET_INPUT_FOCUSED.bindTo(this._contextKeyService);
this.findWidgetVisible = KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE.bindTo(this._contextKeyService);
......@@ -207,7 +207,7 @@ export class WebviewEditor extends BaseWebviewEditor {
enableWrappedPostMessage: true,
useSameOriginForRoot: false
});
this._webview.mountTo(this.webviewContent);
this._webview.mountTo(this._webviewContent);
input.webview = this._webview;
if (input.options.tryRestoreScrollPosition) {
......@@ -216,7 +216,7 @@ export class WebviewEditor extends BaseWebviewEditor {
this._webview.state = input.webviewState;
this.content.setAttribute('aria-flowto', this.webviewContent.id);
this._content.setAttribute('aria-flowto', this._webviewContent.id);
this.doUpdateContainer();
return this._webview;
......@@ -230,7 +230,7 @@ export class WebviewEditor extends BaseWebviewEditor {
this._webviewFocusListenerDisposable.dispose();
}
this._webviewFocusTracker = DOM.trackFocus(this.webviewContent);
this._webviewFocusTracker = DOM.trackFocus(this._webviewContent);
this._webviewFocusListenerDisposable = this._webviewFocusTracker.onDidFocus(() => {
this._onDidFocusWebview.fire();
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册