Fix view model editor and webview component (#1483)

* destroy viewmodel when editor is closed and add example

* support retainContextWhenHidden option for webview component

* fix breaking change from master

* dispose html element during dispose

* add more comments
This commit is contained in:
Abbie Petchtes
2018-05-24 13:54:41 -07:00
committed by GitHub
parent 1359354387
commit c208abf0c5
11 changed files with 176 additions and 147 deletions

View File

@@ -76,13 +76,14 @@ class ModelViewEditorImpl extends ModelViewPanelImpl implements sqlops.workspace
extHostModelViewDialog: ExtHostModelViewDialog,
extHostModelView: ExtHostModelViewShape,
private _proxy: MainThreadModelViewDialogShape,
private _title: string
private _title: string,
private _options: sqlops.ModelViewEditorOptions
) {
super('modelViewEditor', extHostModelViewDialog, extHostModelView);
}
public openEditor(position?: vscode.ViewColumn): Thenable<void> {
return this._proxy.$openEditor(this._modelViewId, this._title, position);
return this._proxy.$openEditor(this._modelViewId, this._title, this._options, position);
}
}
@@ -345,8 +346,8 @@ export class ExtHostModelViewDialog implements ExtHostModelViewDialogShape {
this._proxy.$closeDialog(handle);
}
public createModelViewEditor(title: string): sqlops.workspace.ModelViewEditor {
let editor = new ModelViewEditorImpl(this, this._extHostModelView, this._proxy, title);
public createModelViewEditor(title: string, options?: sqlops.ModelViewEditorOptions): sqlops.workspace.ModelViewEditor {
let editor = new ModelViewEditorImpl(this, this._extHostModelView, this._proxy, title, options);
editor.handle = this.getHandle(editor);
return editor;
}