Fix toggle functionality for widgets. (#7178)

Co-authored-by: cccindyyyl <cccindyyyl@users.noreply.github.com>
Co-authored-by: Bojun Li <BojunLi03@users.noreply.github.com>
Co-authored-by: Sen Feng <SenF1@users.noreply.github.com>
Co-authored-by: Ariel Kwak <arielkwak@users.noreply.github.com>
Co-authored-by: Jeremy Tuloup <jeremy.tuloup@gmail.com>
Hao Kang 2 years ago committed by GitHub
parent dbb489a1d6
commit 728807f401
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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();
}
}

Loading…
Cancel
Save