mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-19 01:25:36 -05:00
readd check on start up for tabs (#1585)
This commit is contained in:
@@ -4,15 +4,13 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import {
|
||||
Component, ContentChildren, QueryList, AfterContentInit, Inject, forwardRef, NgZone,
|
||||
OnInit, Input, EventEmitter, Output, ViewChild, ElementRef, OnChanges, OnDestroy, ViewChildren,
|
||||
AfterViewInit
|
||||
Component, ContentChildren, QueryList, Inject, forwardRef, NgZone,
|
||||
Input, EventEmitter, Output, ViewChild, ElementRef
|
||||
} from '@angular/core';
|
||||
|
||||
import './panelStyles';
|
||||
|
||||
import { TabComponent } from './tab.component';
|
||||
import { TabHeaderComponent } from './tabHeader.component';
|
||||
import { ScrollableDirective } from 'sql/base/browser/ui/scrollable/scrollable.directive';
|
||||
import { subscriptionToDisposable } from 'sql/base/common/lifecycle';
|
||||
|
||||
@@ -21,7 +19,6 @@ import { Action } from 'vs/base/common/actions';
|
||||
import * as types from 'vs/base/common/types';
|
||||
import { mixin } from 'vs/base/common/objects';
|
||||
import { ScrollbarVisibility } from 'vs/base/common/scrollable';
|
||||
import { addDisposableListener, EventType } from 'vs/base/browser/dom';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
|
||||
export interface IPanelOptions {
|
||||
@@ -44,9 +41,6 @@ const defaultOptions: IPanelOptions = {
|
||||
showIcon: false
|
||||
};
|
||||
|
||||
const verticalLayout = 'vertical';
|
||||
const horizontalLayout = 'horizontal';
|
||||
|
||||
let idPool = 0;
|
||||
|
||||
@Component({
|
||||
@@ -78,7 +72,6 @@ export class PanelComponent extends Disposable {
|
||||
@Input() public options: IPanelOptions;
|
||||
@Input() public actions: Array<Action>;
|
||||
@ContentChildren(TabComponent) private _tabs: QueryList<TabComponent>;
|
||||
@ViewChildren(TabHeaderComponent) private _headerTabs: QueryList<TabHeaderComponent>;
|
||||
@ViewChild(ScrollableDirective) private scrollable: ScrollableDirective;
|
||||
|
||||
@Output() public onTabChange = new EventEmitter<TabComponent>();
|
||||
@@ -88,8 +81,8 @@ export class PanelComponent extends Disposable {
|
||||
private _actionbar: ActionBar;
|
||||
private _mru: TabComponent[];
|
||||
|
||||
private ScrollbarVisibility = ScrollbarVisibility;
|
||||
private NavigationBarLayout = NavigationBarLayout;
|
||||
protected ScrollbarVisibility = ScrollbarVisibility;
|
||||
protected NavigationBarLayout = NavigationBarLayout;
|
||||
|
||||
@ViewChild('panelActionbar', { read: ElementRef }) private _actionbarRef: ElementRef;
|
||||
constructor( @Inject(forwardRef(() => NgZone)) private _zone: NgZone) {
|
||||
@@ -102,6 +95,10 @@ export class PanelComponent extends Disposable {
|
||||
}
|
||||
|
||||
ngAfterContentInit(): void {
|
||||
if (this._tabs && this._tabs.length > 0) {
|
||||
this.selectTab(this._tabs.first);
|
||||
}
|
||||
|
||||
this._register(subscriptionToDisposable(this._tabs.changes.subscribe(() => {
|
||||
if (this._tabs && this._tabs.length > 0) {
|
||||
this.selectTab(this._tabs.first);
|
||||
|
||||
Reference in New Issue
Block a user