From 406fbc7690ee72f6f96ecf68f1238822ae8951c2 Mon Sep 17 00:00:00 2001 From: Ian Tenney Date: Thu, 15 Feb 2024 19:07:26 -0800 Subject: [PATCH] Fix issue with URL params not updating when un-maximizing a module. Previously, this did not clear the expanded_module= bit, so sharing a link or refreshing the page would cause the module to maximize again. PiperOrigin-RevId: 607529159 --- lit_nlp/client/core/widget_group.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lit_nlp/client/core/widget_group.ts b/lit_nlp/client/core/widget_group.ts index 92802c6e..23210608 100644 --- a/lit_nlp/client/core/widget_group.ts +++ b/lit_nlp/client/core/widget_group.ts @@ -99,8 +99,7 @@ export class WidgetGroup extends ReactiveElement { // Maximization. const onMaxClick = () => { - this.maximized = !this.maximized; - this.setMaximized(this.maximized); + this.setMaximized(!this.maximized); this.setMinimized(false); }; @@ -114,7 +113,7 @@ export class WidgetGroup extends ReactiveElement { const onTitleClick = () => { if (this.minimized) { this.setMinimized(false); - this.maximized = false; + this.setMaximized(false); } }; @@ -220,7 +219,8 @@ export class WidgetGroup extends ReactiveElement { // For clicks on the maximized-module darkened background, undo the // module maximization. const onBackgroundClick = () => { - this.maximized = false; + this.setMaximized(false); + this.setMinimized(false); }; // A listener to stop clicks on a maximized module from causing the // background click listener from firing.