mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Fix Agent tabs not switching
(cherry picked from commit 6f15ebcf6fe1f4976e82e3ee71cfba0d35fa2b7c)
This commit is contained in:
@@ -50,7 +50,7 @@ interface IInternalPanelTab {
|
|||||||
disposables: IDisposable[];
|
disposables: IDisposable[];
|
||||||
label: HTMLElement;
|
label: HTMLElement;
|
||||||
body?: HTMLElement;
|
body?: HTMLElement;
|
||||||
destoryTabBody?: boolean;
|
destroyTabBody?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultOptions: IPanelOptions = {
|
const defaultOptions: IPanelOptions = {
|
||||||
@@ -115,10 +115,10 @@ export class TabbedPanel extends Disposable {
|
|||||||
return this._tabMap.has(tab.identifier);
|
return this._tabMap.has(tab.identifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
public pushTab(tab: IPanelTab, index?: number, destoryTabBody?: boolean): PanelTabIdentifier {
|
public pushTab(tab: IPanelTab, index?: number, destroyTabBody?: boolean): PanelTabIdentifier {
|
||||||
let internalTab = { tab } as IInternalPanelTab;
|
let internalTab = { tab } as IInternalPanelTab;
|
||||||
internalTab.disposables = [];
|
internalTab.disposables = [];
|
||||||
internalTab.destoryTabBody = destoryTabBody;
|
internalTab.destroyTabBody = destroyTabBody;
|
||||||
this._tabMap.set(tab.identifier, internalTab);
|
this._tabMap.set(tab.identifier, internalTab);
|
||||||
this._createTab(internalTab, index);
|
this._createTab(internalTab, index);
|
||||||
if (!this._shownTabId) {
|
if (!this._shownTabId) {
|
||||||
@@ -203,7 +203,7 @@ export class TabbedPanel extends Disposable {
|
|||||||
this.tabHistory.push(id);
|
this.tabHistory.push(id);
|
||||||
const tab = this._tabMap.get(this._shownTabId)!; // @anthonydresser we know this can't be undefined since we check further up if the map contains the id
|
const tab = this._tabMap.get(this._shownTabId)!; // @anthonydresser we know this can't be undefined since we check further up if the map contains the id
|
||||||
|
|
||||||
if (tab.destoryTabBody && tab.body) {
|
if (tab.destroyTabBody && tab.body) {
|
||||||
tab.body.remove();
|
tab.body.remove();
|
||||||
tab.body = undefined;
|
tab.body = undefined;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ const PREVIOUS_LABEL = nls.localize('dialogPreviousLabel', 'Previous');
|
|||||||
|
|
||||||
class ModelViewPanelImpl implements azdata.window.ModelViewPanel {
|
class ModelViewPanelImpl implements azdata.window.ModelViewPanel {
|
||||||
private _modelView: azdata.ModelView;
|
private _modelView: azdata.ModelView;
|
||||||
private static _handle: number;
|
private _handle: number;
|
||||||
protected _modelViewId: string;
|
protected _modelViewId: string;
|
||||||
protected _valid: boolean = true;
|
protected _valid: boolean = true;
|
||||||
protected _onValidityChanged: vscode.Event<boolean>;
|
protected _onValidityChanged: vscode.Event<boolean>;
|
||||||
@@ -37,7 +37,7 @@ class ModelViewPanelImpl implements azdata.window.ModelViewPanel {
|
|||||||
|
|
||||||
public registerContent(handler: (view: azdata.ModelView) => Thenable<void>): void {
|
public registerContent(handler: (view: azdata.ModelView) => Thenable<void>): void {
|
||||||
if (!this._modelViewId) {
|
if (!this._modelViewId) {
|
||||||
let viewId = this._viewType + ModelViewPanelImpl._handle;
|
let viewId = this._viewType + this._handle;
|
||||||
this.setModelViewId(viewId);
|
this.setModelViewId(viewId);
|
||||||
this._extHostModelView.$registerProvider(viewId, modelView => {
|
this._extHostModelView.$registerProvider(viewId, modelView => {
|
||||||
this._modelView = modelView;
|
this._modelView = modelView;
|
||||||
@@ -47,7 +47,7 @@ class ModelViewPanelImpl implements azdata.window.ModelViewPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public set handle(value: number) {
|
public set handle(value: number) {
|
||||||
ModelViewPanelImpl._handle = value;
|
this._handle = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public setModelViewId(value: string) {
|
public setModelViewId(value: string) {
|
||||||
|
|||||||
Reference in New Issue
Block a user