mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-21 04:20:11 -04:00
This reverts commit d15a3fcc98.
This commit is contained in:
@@ -8,7 +8,7 @@ import * as dom from 'vs/base/browser/dom';
|
||||
import { IHorizontalSashLayoutProvider, ISashEvent, Orientation, Sash, SashState } from 'vs/base/browser/ui/sash/sash';
|
||||
import { Color, RGBA } from 'vs/base/common/color';
|
||||
import { IdGenerator } from 'vs/base/common/idGenerator';
|
||||
import { DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import * as objects from 'vs/base/common/objects';
|
||||
import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, IViewZone, IViewZoneChangeAccessor } from 'vs/editor/browser/editorBrowser';
|
||||
import { EditorLayoutInfo } from 'vs/editor/common/config/editorOptions';
|
||||
@@ -165,7 +165,7 @@ export abstract class ZoneWidget implements IHorizontalSashLayoutProvider {
|
||||
private _positionMarkerId: string[] = [];
|
||||
|
||||
protected _viewZone: ViewZoneDelegate | null;
|
||||
protected readonly _disposables = new DisposableStore();
|
||||
protected _disposables: IDisposable[] = [];
|
||||
|
||||
public container: HTMLElement;
|
||||
public domNode: HTMLElement;
|
||||
@@ -183,7 +183,7 @@ export abstract class ZoneWidget implements IHorizontalSashLayoutProvider {
|
||||
this.domNode.setAttribute('role', 'presentation');
|
||||
}
|
||||
|
||||
this._disposables.add(this.editor.onDidLayoutChange((info: EditorLayoutInfo) => {
|
||||
this._disposables.push(this.editor.onDidLayoutChange((info: EditorLayoutInfo) => {
|
||||
const width = this._getWidth(info);
|
||||
this.domNode.style.width = width + 'px';
|
||||
this.domNode.style.left = this._getLeft(info) + 'px';
|
||||
@@ -193,7 +193,7 @@ export abstract class ZoneWidget implements IHorizontalSashLayoutProvider {
|
||||
|
||||
public dispose(): void {
|
||||
|
||||
this._disposables.dispose();
|
||||
dispose(this._disposables);
|
||||
|
||||
if (this._overlayWidget) {
|
||||
this.editor.removeOverlayWidget(this._overlayWidget);
|
||||
@@ -225,7 +225,7 @@ export abstract class ZoneWidget implements IHorizontalSashLayoutProvider {
|
||||
this.domNode.appendChild(this.container);
|
||||
if (this.options.showArrow) {
|
||||
this._arrow = new Arrow(this.editor);
|
||||
this._disposables.add(this._arrow);
|
||||
this._disposables.push(this._arrow);
|
||||
}
|
||||
this._fillContainer(this.container);
|
||||
this._initSash();
|
||||
@@ -470,10 +470,7 @@ export abstract class ZoneWidget implements IHorizontalSashLayoutProvider {
|
||||
// --- sash
|
||||
|
||||
private _initSash(): void {
|
||||
if (this._resizeSash) {
|
||||
return;
|
||||
}
|
||||
this._resizeSash = this._disposables.add(new Sash(this.domNode, this, { orientation: Orientation.HORIZONTAL }));
|
||||
this._resizeSash = new Sash(this.domNode, this, { orientation: Orientation.HORIZONTAL });
|
||||
|
||||
if (!this.options.isResizeable) {
|
||||
this._resizeSash.hide();
|
||||
@@ -481,7 +478,7 @@ export abstract class ZoneWidget implements IHorizontalSashLayoutProvider {
|
||||
}
|
||||
|
||||
let data: { startY: number; heightInLines: number; } | undefined;
|
||||
this._disposables.add(this._resizeSash.onDidStart((e: ISashEvent) => {
|
||||
this._disposables.push(this._resizeSash.onDidStart((e: ISashEvent) => {
|
||||
if (this._viewZone) {
|
||||
data = {
|
||||
startY: e.startY,
|
||||
@@ -490,11 +487,11 @@ export abstract class ZoneWidget implements IHorizontalSashLayoutProvider {
|
||||
}
|
||||
}));
|
||||
|
||||
this._disposables.add(this._resizeSash.onDidEnd(() => {
|
||||
this._disposables.push(this._resizeSash.onDidEnd(() => {
|
||||
data = undefined;
|
||||
}));
|
||||
|
||||
this._disposables.add(this._resizeSash.onDidChange((evt: ISashEvent) => {
|
||||
this._disposables.push(this._resizeSash.onDidChange((evt: ISashEvent) => {
|
||||
if (data) {
|
||||
let lineDelta = (evt.currentY - data.startY) / this.editor.getConfiguration().lineHeight;
|
||||
let roundedLineDelta = lineDelta < 0 ? Math.ceil(lineDelta) : Math.floor(lineDelta);
|
||||
|
||||
Reference in New Issue
Block a user