From fc405163ba05b00eebab40085541efcdc642f8d3 Mon Sep 17 00:00:00 2001 From: zemeolotu Date: Tue, 19 Nov 2019 13:26:36 -0500 Subject: [PATCH 1/2] Fix workspace bug when tabbed widgets are moved to master --- .../perspective-phosphor/src/ts/widget.ts | 23 ++++++------------- .../src/ts/workspace/workspace.ts | 1 + 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/packages/perspective-phosphor/src/ts/widget.ts b/packages/perspective-phosphor/src/ts/widget.ts index 6839320e8d..bddb0854ed 100644 --- a/packages/perspective-phosphor/src/ts/widget.ts +++ b/packages/perspective-phosphor/src/ts/widget.ts @@ -86,8 +86,6 @@ export class PerspectiveWidget extends Widget { // do computed last this.computed_columns = computed_columns; this.filters = filters; - - this._displayed = false; } /**********************/ @@ -120,9 +118,7 @@ export class PerspectiveWidget extends Widget { } notifyResize(): void { - if (this.isAttached && !this.displayed) { - this._displayed = true; - } else if (this.isAttached) { + if (this.isVisible) { this.viewer.notifyResize(); } } @@ -140,14 +136,14 @@ export class PerspectiveWidget extends Widget { * * @param table a `perspective.table` object. */ - load(table: (TableData | Table), options?: TableOptions): void { + load(table: TableData | Table, options?: TableOptions): void { this.viewer.load(table, options); } /** * Update the viewer with new data. - * - * @param data + * + * @param data */ _update(data: TableData): void { this.viewer.update(data); @@ -163,7 +159,7 @@ export class PerspectiveWidget extends Widget { /** * Replaces the data of the viewer's table with new data. New data must conform * to the schema of the Table. - * + * * @param data */ replace(data: TableData): void { @@ -311,7 +307,7 @@ export class PerspectiveWidget extends Widget { this.node.classList.add(PSP_CONTAINER_CLASS); this.node.classList.remove(PSP_CONTAINER_CLASS_DARK); } - if (this._displayed) { + if (this.isAttached) { this.viewer.restyleElement(); } } @@ -328,14 +324,10 @@ export class PerspectiveWidget extends Widget { } } - toggleConfig() { + toggleConfig(): void { this._viewer.toggleConfig(); } - get displayed(): boolean { - return this._displayed; - } - static createNode(node: HTMLDivElement): PerspectiveViewer { node.classList.add("p-Widget"); node.classList.add(PSP_CONTAINER_CLASS); @@ -370,5 +362,4 @@ export class PerspectiveWidget extends Widget { private _client: boolean; private _dark: boolean; private _editable: boolean; - private _displayed: boolean; } diff --git a/packages/perspective-phosphor/src/ts/workspace/workspace.ts b/packages/perspective-phosphor/src/ts/workspace/workspace.ts index 11bfd12ef4..ce60773809 100644 --- a/packages/perspective-phosphor/src/ts/workspace/workspace.ts +++ b/packages/perspective-phosphor/src/ts/workspace/workspace.ts @@ -98,6 +98,7 @@ export class PerspectiveWorkspace extends SplitPanel { } this.masterpanel.addWidget(widget); + widget.isHidden && widget.show(); widget.viewer.restyleElement(); widget.viewer.addEventListener("perspective-click", this.onPerspectiveClick); From feede9a6abe07735d3a8d08522333a17942eb951 Mon Sep 17 00:00:00 2001 From: zemeolotu Date: Tue, 19 Nov 2019 13:44:24 -0500 Subject: [PATCH 2/2] Add icon for `Detail` menu item --- packages/perspective-phosphor/src/theme/material/menu.less | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/perspective-phosphor/src/theme/material/menu.less b/packages/perspective-phosphor/src/theme/material/menu.less index 96b6fc68e2..2cc4fb133d 100644 --- a/packages/perspective-phosphor/src/theme/material/menu.less +++ b/packages/perspective-phosphor/src/theme/material/menu.less @@ -147,3 +147,8 @@ content: "cast"; font-family: "Material Icons"; } + +.p-MenuItem-detail:before { + content: "notes"; + font-family: "Material Icons"; +}