From 4e37b0bab041b72f3d40cb161f9a60f78e289d69 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Tue, 22 Jun 2021 14:57:46 +0000 Subject: [PATCH] [FIX] web: navbar: do not change url hash on item clicked Before this commit, when clicking on menus or debug items or use menu items the URL briefly changed pushing an unwanted history entry. We do want those to be links (tag `a`) with an href to be able to open in a new tab. But we don't want the current url hash to change because of it. This commit fixes this. --- addons/web/static/src/core/debug/debug_menu.xml | 2 +- addons/web/static/src/webclient/navbar/navbar.xml | 11 ++++++----- .../web/static/src/webclient/user_menu/user_menu.xml | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/addons/web/static/src/core/debug/debug_menu.xml b/addons/web/static/src/core/debug/debug_menu.xml index 3c383283ea3..948caad0e78 100644 --- a/addons/web/static/src/core/debug/debug_menu.xml +++ b/addons/web/static/src/core/debug/debug_menu.xml @@ -12,7 +12,7 @@ - + diff --git a/addons/web/static/src/webclient/navbar/navbar.xml b/addons/web/static/src/webclient/navbar/navbar.xml index f2da688d5c9..4061c8512cb 100644 --- a/addons/web/static/src/webclient/navbar/navbar.xml +++ b/addons/web/static/src/webclient/navbar/navbar.xml @@ -20,7 +20,7 @@ t-esc="currentApp.name" class="o_menu_brand" t-ref="menuBrand" - t-on-click="menuService.selectMenu(currentApp)" + t-on-click.prevent="menuService.selectMenu(currentApp)" /> @@ -54,7 +54,7 @@ t-att-class="{ o_dropdown_active: menuService.getCurrentApp() === app }" payload="app" > - + @@ -80,6 +80,7 @@ @@ -115,7 +116,7 @@ - + @@ -126,7 +127,7 @@ t-key="subItem.id" class="o_dropdown_menu_group_entry" payload="subItem"> - + @@ -140,7 +141,7 @@ - + diff --git a/addons/web/static/src/webclient/user_menu/user_menu.xml b/addons/web/static/src/webclient/user_menu/user_menu.xml index ee94e2a5e34..076f5298245 100644 --- a/addons/web/static/src/webclient/user_menu/user_menu.xml +++ b/addons/web/static/src/webclient/user_menu/user_menu.xml @@ -9,7 +9,7 @@ - +