[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>
This commit is contained in:
Romain Derie
2019-08-26 10:37:30 +00:00
parent 389bd53a0b
commit cfbaba81c2
+2 -1
View File
@@ -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);
},
});