Skip to content

Commit

Permalink
Merge pull request #831 from finos/workspace-fixes
Browse files Browse the repository at this point in the history
Fix `PerspectiveWorkspace` when tabbed views are moved to master
  • Loading branch information
texodus authored Dec 4, 2019
2 parents 837336d + 791e3da commit fc2e189
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
5 changes: 5 additions & 0 deletions packages/perspective-phosphor/src/theme/material/menu.less
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,8 @@
content: "cast";
font-family: "Material Icons";
}

.p-MenuItem-detail:before {
content: "notes";
font-family: "Material Icons";
}
15 changes: 3 additions & 12 deletions packages/perspective-phosphor/src/ts/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ export class PerspectiveWidget extends Widget {
// do computed last
this.computed_columns = computed_columns;
this.filters = filters;

this._displayed = false;
}

/**********************/
Expand Down Expand Up @@ -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();
}
}
Expand Down Expand Up @@ -327,7 +323,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();
}
}
Expand All @@ -344,14 +340,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);
Expand Down Expand Up @@ -387,5 +379,4 @@ export class PerspectiveWidget extends Widget {
private _client: boolean;
private _dark: boolean;
private _editable: boolean;
private _displayed: boolean;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fc2e189

Please sign in to comment.