Skip to content

Commit

Permalink
Revert "Refactor results grid (#2147)"
Browse files Browse the repository at this point in the history
This reverts commit befa347.
  • Loading branch information
kburtram committed Aug 24, 2018
1 parent df617f1 commit cef195c
Show file tree
Hide file tree
Showing 42 changed files with 1,414 additions and 3,476 deletions.
4 changes: 0 additions & 4 deletions extensions/insights-default/yarn.lock

This file was deleted.

4 changes: 0 additions & 4 deletions extensions/markdown-basics/yarn.lock

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@angular/router": "~4.1.3",
"@angular/upgrade": "~4.1.3",
"angular2-grid": "2.0.6",
"angular2-slickgrid": "github:Microsoft/angular2-slickgrid#1.4.4",
"angular2-slickgrid": "github:Microsoft/angular2-slickgrid#1.4.3",
"applicationinsights": "0.18.0",
"chart.js": "^2.6.0",
"fast-plist": "0.1.2",
Expand Down
38 changes: 8 additions & 30 deletions src/sql/base/browser/ui/panel/panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
*--------------------------------------------------------------------------------------------*/

import { IThemable } from 'vs/platform/theme/common/styler';
import * as objects from 'sql/base/common/objects';
import { Event, Emitter } from 'vs/base/common/event';
import { Dimension, EventType } from 'vs/base/browser/dom';
import { Dimension } from 'vs/base/browser/dom';
import { $, Builder } from 'vs/base/browser/builder';
import { EventType } from 'vs/base/browser/dom';
import { IAction } from 'vs/base/common/actions';
import { IActionOptions, ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
Expand All @@ -15,16 +17,12 @@ import './panelStyles';
import { Disposable } from 'vs/base/common/lifecycle';

export interface IPanelStyles {
}

export interface IPanelOptions {
showHeaderWhenSingleView?: boolean;
}

export interface IPanelView {
render(container: HTMLElement): void;
layout(dimension: Dimension): void;
remove?(): void;
}

export interface IPanelTab {
Expand All @@ -38,10 +36,6 @@ interface IInternalPanelTab extends IPanelTab {
label: Builder;
}

const defaultOptions: IPanelOptions = {
showHeaderWhenSingleView: true
};

export type PanelTabIdentifier = string;

export class TabbedPanel extends Disposable implements IThemable {
Expand All @@ -55,12 +49,11 @@ export class TabbedPanel extends Disposable implements IThemable {
private _actionbar: ActionBar;
private _currentDimensions: Dimension;
private _collapsed = false;
private _headerVisible: boolean;

private _onTabChange = new Emitter<PanelTabIdentifier>();
public onTabChange: Event<PanelTabIdentifier> = this._onTabChange.event;

constructor(private container: HTMLElement, private options: IPanelOptions = defaultOptions) {
constructor(private container: HTMLElement) {
super();
this.$parent = this._register($('.tabbedPanel'));
this.$parent.appendTo(container);
Expand All @@ -72,29 +65,20 @@ export class TabbedPanel extends Disposable implements IThemable {
let actionbarcontainer = $('.title-actions');
this._actionbar = new ActionBar(actionbarcontainer.getHTMLElement());
this.$header.append(actionbarcontainer);
if (options.showHeaderWhenSingleView) {
this._headerVisible = true;
this.$parent.append(this.$header);
} else {
this._headerVisible = false;
}
this.$parent.append(this.$header);
this.$body = $('tabBody');
this.$body.attr('role', 'tabpanel');
this.$body.attr('tabindex', '0');
this.$parent.append(this.$body);
}

public pushTab(tab: IPanelTab): PanelTabIdentifier {
let internalTab = tab as IInternalPanelTab;
let internalTab = objects.clone(tab) as IInternalPanelTab;
this._tabMap.set(tab.identifier, internalTab);
this._createTab(internalTab);
if (!this._shownTab) {
this.showTab(tab.identifier);
}
if (this._tabMap.size > 1 && !this._headerVisible) {
this.$parent.append(this.$header, 0);
this._headerVisible = true;
}
return tab.identifier as PanelTabIdentifier;
}

Expand Down Expand Up @@ -155,11 +139,6 @@ export class TabbedPanel extends Disposable implements IThemable {
}

public removeTab(tab: PanelTabIdentifier) {
let actualTab = this._tabMap.get(tab);
actualTab.header.destroy();
if (actualTab.view.remove) {
actualTab.view.remove();
}
this._tabMap.get(tab).header.destroy();
this._tabMap.delete(tab);
}
Expand All @@ -172,9 +151,8 @@ export class TabbedPanel extends Disposable implements IThemable {
this._currentDimensions = dimension;
this.$header.style('width', dimension.width + 'px');
this.$body.style('width', dimension.width + 'px');
const bodyHeight = dimension.height - (this._headerVisible ? this.headersize : 0);
this.$body.style('height', bodyHeight + 'px');
this._layoutCurrentTab(new Dimension(dimension.width, bodyHeight));
this.$body.style('height', (dimension.height - this.headersize) + 'px');
this._layoutCurrentTab(new Dimension(dimension.width, dimension.height - this.headersize));
}

private _layoutCurrentTab(dimension: Dimension): void {
Expand Down
212 changes: 0 additions & 212 deletions src/sql/base/browser/ui/scrollableSplitview/heightMap.ts

This file was deleted.

This file was deleted.

Loading

0 comments on commit cef195c

Please sign in to comment.