From 237e957d1699fb4da756e9acc98c527f282e90b0 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Fri, 7 Jul 2023 12:00:17 -0500 Subject: Fixes and improvements to the Profile Preview modal (#992) * Fix: use more reliable navigation method * Fix: show lightbox over the active modal * Fix: close the profile preview on navigation * Factor out UserPreviewLink and add preview behavior to notifications * Fix postmeta overflow on web * Fix lint --- src/state/models/ui/shell.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/state/models/ui/shell.ts') diff --git a/src/state/models/ui/shell.ts b/src/state/models/ui/shell.ts index c6e7289df..a0e0cd7b2 100644 --- a/src/state/models/ui/shell.ts +++ b/src/state/models/ui/shell.ts @@ -279,6 +279,24 @@ export class ShellUiModel { return false } + /** + * used to clear out any modals, eg for a navigation + */ + closeAllActiveElements() { + if (this.isLightboxActive) { + this.closeLightbox() + } + while (this.isModalActive) { + this.closeModal() + } + if (this.isComposerActive) { + this.closeComposer() + } + if (this.isDrawerOpen) { + this.closeDrawer() + } + } + openDrawer() { this.isDrawerOpen = true } -- cgit 1.4.1