diff options
| author | Alexandre Kühn <aku@odoo.com> | 2018-09-18 16:15:06 +0200 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2018-09-18 18:12:03 +0200 |
| commit | 95331042f180f4bdb14e2164237391ff8610ea31 (patch) | |
| tree | 681c900cda3fe04a2ed1789faf84627d6f5fd5f1 /addons/web/static/src/xml | |
| parent | 53908da50c2b10fb521ac090e7c2a93018e75ff6 (diff) | |
[FIX] web: do not re-render app menu on every app click
This was necessary because the rendering was always determining
which app item should have the class 'active'.
This was an issue with the 'Click Everywhere Test': at the beginning
of the script, it gets the jQuery element that matches all nodes
`a.o_app` in the app menu. When an app item is clicked, it re-renders
the whole app menu, so that older referenced nodes are detached from
the DOM. As a result, clicking on them no longer works, because it
never triggers the MouseEvent `click .o_app`.
This commit fixes the issue by rendering the whole app menu once.
When an item in the app menu is clicked, it dynamically changes
the `active` app.
Diffstat (limited to 'addons/web/static/src/xml')
| -rw-r--r-- | addons/web/static/src/xml/menu.xml | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/addons/web/static/src/xml/menu.xml b/addons/web/static/src/xml/menu.xml index 1649e630547..24607380017 100644 --- a/addons/web/static/src/xml/menu.xml +++ b/addons/web/static/src/xml/menu.xml @@ -18,11 +18,10 @@ <a class="dropdown-toggle full" data-toggle="dropdown" href="#"> <i class="fa fa-th-large"/> </a> - <t t-set="activeApp" t-value="widget.getActiveApp()"/> <div class="dropdown-menu" role="menu"> <t t-foreach="widget.getApps()" t-as="app"> <a role="menuitem" - t-attf-class="dropdown-item o_app #{activeApp.menuID === app.menuID ? 'active' : ''}" + class="dropdown-item o_app" t-att-data-menu-id="app.menuID" t-att-data-menu-xmlid="app.xmlID" t-att-data-action-id="app.actionID"> |
