summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js/content/menu.js
diff options
context:
space:
mode:
authorRomain Derie <rde@odoo.com>2019-08-26 10:37:30 +0000
committerRomain Derie <rde@odoo.com>2019-08-26 10:37:30 +0000
commitcfbaba81c240b438a4d790fa63d5472b14d9b92c (patch)
treef3c06470b23c0bf380a5e7b0d3a0defba6dd0220 /addons/website/static/src/js/content/menu.js
parent389bd53a0bcde0d5911f15a09cd03a84678b5380 (diff)
[FIX] website: correctly close dropdown menu on scroll
Before this commit, the code that was supposed to close the dropdown in the navbar when scrolling was not working anymore. Indeed, it would removes the `show` class from the `nav-item dropdown` (dropdown menu entry) but not from the `dropdown-menu` (dropdown content). Fixes #35320 closes odoo/odoo#36069 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/website/static/src/js/content/menu.js')
-rw-r--r--addons/website/static/src/js/content/menu.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/website/static/src/js/content/menu.js b/addons/website/static/src/js/content/menu.js
index d64a3891bfd..00af3201b81 100644
--- a/addons/website/static/src/js/content/menu.js
+++ b/addons/website/static/src/js/content/menu.js
@@ -21,6 +21,7 @@ sAnimation.registry.affixMenu = sAnimation.Class.extend({
this.$headerClone.insertAfter(this.$target);
this.$headers = this.$target.add(this.$headerClone);
this.$dropdowns = this.$headers.find('.dropdown');
+ this.$dropdownMenus = this.$headers.find('.dropdown-menu');
this.$navbarCollapses = this.$headers.find('.navbar-collapse');
// Handle events for the collapse menus
@@ -69,7 +70,7 @@ sAnimation.registry.affixMenu = sAnimation.Class.extend({
this.$headerClone.toggleClass('affixed', wOffset > (hOffset + 300));
// Reset opened menus
- this.$dropdowns.removeClass('show');
+ this.$dropdowns.add(this.$dropdownMenus).removeClass('show');
this.$navbarCollapses.removeClass('show').attr('aria-expanded', false);
},
});