From 7fac8010752ec2af309e860d1793d905f106fb14 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Wed, 7 Mar 2018 14:58:31 +0100 Subject: [PATCH] [FIX] web: mobile: display searchview toggler There was an issue with the control panel in mobile since rev. 7b6056a. In the enterprise webclient, by default, the search view is hidden, and a search icon should be displayed on the top right corner of the control panel so that the user can toggle the searchview. Before this rev., the icon was invisible at the first rendering of a view, and only appeared once the view was reloaded. The change in rev. 7b6056a that produced the issue is that the control panel is now updated twice when a view is rendered (once by the view itself with the buttons, searchview..., and once by the ActionManager with the breadcrumbs). The control panel didn't handle correctly that scenario. A test case will been added in web_enterprise. --- addons/web/static/src/js/chrome/control_panel.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/chrome/control_panel.js b/addons/web/static/src/js/chrome/control_panel.js index 16b22761581..03b9e756bb7 100644 --- a/addons/web/static/src/js/chrome/control_panel.js +++ b/addons/web/static/src/js/chrome/control_panel.js @@ -154,7 +154,9 @@ var ControlPanel = Widget.extend({ this._attach_content(new_cp_content); // Update the searchview and switch buttons - this._update_search_view(status.searchview, status.search_view_hidden, status.groupable); + if (status.searchview || options.clear) { + this._update_search_view(status.searchview, status.search_view_hidden, status.groupable); + } if (status.active_view_selector) { this._update_switch_buttons(status.active_view_selector); }