From 728dd3092bbd7b7c9064dbb12adb3730235130cf Mon Sep 17 00:00:00 2001 From: ericlinagora <162304020+ericlinagora@users.noreply.github.com> Date: Fri, 15 Mar 2024 16:50:11 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20Make=20app=20grid=20popup=20menu?= =?UTF-8?q?=20toggle=20visibility=20when=20clicking=20on=20it=20(#325)=20(?= =?UTF-8?q?#448)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🚸 Make app grid popup menu toggle visibility when clicking on it (#325) --- changelog.md | 12 ++++++--- .../src/app/components/menus/menu.jsx | 27 +++++++++---------- .../frontend/src/app/environment/version.ts | 2 +- .../src/app/views/client/common/app-grid.tsx | 1 + 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/changelog.md b/changelog.md index ca5a7fb7..f9ca698a 100644 --- a/changelog.md +++ b/changelog.md @@ -3,16 +3,20 @@ ## Features - New Version Semantics -- Usage quota settings -- PostgreSQL support as a metadata database +- Usage quota settings +- PostgreSQL support as a metadata database - OpenSearch support as a search database - New API to check file storage consistency - UX improvements - - Remove the switcher from breadcrumbs + - Remove the switcher from breadcrumbs + - Improved translations +- Be able to use SMTP transport without TLS +- Do not display deleted items in the shared with me section ## BugFixes - Fix preview of the files on mobile and web -- Malformed URL when you share a file +- Malformed URL when you share a file +- ... # Twake Drive v2023.Q3.012 diff --git a/tdrive/frontend/src/app/components/menus/menu.jsx b/tdrive/frontend/src/app/components/menus/menu.jsx index b201e411..ca94c793 100755 --- a/tdrive/frontend/src/app/components/menus/menu.jsx +++ b/tdrive/frontend/src/app/components/menus/menu.jsx @@ -22,10 +22,6 @@ export default class Menu extends React.Component { } */ - static closeAll() { - MenusManager.closeAllMenus(); // Corrected method name to closeAllMenus() - } - constructor(props) { super(props); this.state = { @@ -51,21 +47,24 @@ export default class Menu extends React.Component { MenusManager.openMenu(menu, rect, position); } - openMenu(evt) { + async openMenu(evt) { if (this.open) { - this.closeAll(); + this.open = false; + MenusManager.closeMenu(); + this.setState({ isMenuOpen: false }); } else { - this.open = true; evt.preventDefault(); evt.stopPropagation(); var elementRect = this.container.current.getBoundingClientRect(); // Fixed getBoundingClientRect() elementRect.x = elementRect.x || elementRect.left; elementRect.y = elementRect.y || elementRect.top; - this.previousMenusId = MenusManager.openMenu( // Updated variable name + this.previousMenusId = await MenusManager.openMenu( this.props.menu, elementRect, this.props.position, ); + this.setState({ isMenuOpen: true }, () => this.open = true); + this.open = true; if (this.props.onOpen) this.props.onOpen(); } } @@ -77,7 +76,7 @@ export default class Menu extends React.Component { if ( (MenusManager.menus.length === 0 && this.previousMenusNumber > 0) || - MenusManager.lastOpenedId !== this.previousMenusId // Updated variable name + MenusManager.last_opened_id !== this.previousMenusId ) { if (this.open && this.props.onClose) { this.props.onClose(); @@ -103,18 +102,18 @@ export default class Menu extends React.Component {