Skip to content

Commit

Permalink
Fix toggle functionality for widgets. (#7178)
Browse files Browse the repository at this point in the history
Co-authored-by: cccindyyyl <[email protected]>
Co-authored-by: Bojun Li <[email protected]>
Co-authored-by: Sen Feng <[email protected]>
Co-authored-by: Ariel Kwak <[email protected]>
Co-authored-by: Jeremy Tuloup <[email protected]>
  • Loading branch information
6 people authored Dec 11, 2023
1 parent dbb489a commit 728807f
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions packages/application/src/panelhandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,20 @@ export class SidePanelHandler extends PanelHandler {
* if there is no most recently used.
*/
expand(id?: string): void {
if (this._currentWidget) {
this.collapse();
}
if (id) {
this.activate(id);
} else {
const visibleWidget = this.currentWidget;
if (visibleWidget) {
this._currentWidget = visibleWidget;
this.activate(visibleWidget.id);
if (this._currentWidget && this._currentWidget.id === id) {
this.collapse();
this.hide();
} else {
this.collapse();
this.hide();
this.activate(id);
this.show();
}
} else if (this.currentWidget) {
this._currentWidget = this.currentWidget;
this.activate(this._currentWidget.id);
this.show();
}
}

Expand Down

0 comments on commit 728807f

Please sign in to comment.