summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2015-05-04 08:41:07 +0200
committerAaron Bohy <aab@odoo.com>2015-05-04 08:41:07 +0200
commit560386a7521d0a4a8ec3260574bd5c0798788bf8 (patch)
treea71e95019632d04062f0e4535f2de3a67fc63175 /addons/web/static/src
parent6e131a5c0f1dc70396978e1bad534825eab8407e (diff)
[FIX] ControlPanel: search options visible
Show the searchview buttons area if there is no searchview displayed in the ControlPanel, since client actions may insert elements into it.
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/control_panel.js18
1 files changed, 12 insertions, 6 deletions
diff --git a/addons/web/static/src/js/control_panel.js b/addons/web/static/src/js/control_panel.js
index 12668552ee2..5e607d86a5c 100644
--- a/addons/web/static/src/js/control_panel.js
+++ b/addons/web/static/src/js/control_panel.js
@@ -126,8 +126,8 @@ var ControlPanel = Widget.extend({
// again in the ControlPanel will removed them from there they should be
this._detach_content();
this._attach_content(status.cp_content);
+ this.update_search_view(status.searchview, status.search_view_hidden);
if (status.active_view_selector) this.update_switch_buttons(status.active_view_selector);
- if (status.searchview) this.update_search_view(status.searchview, status.search_view_hidden);
if (status.breadcrumbs) this.update_breadcrumbs(status.breadcrumbs);
}
},
@@ -175,11 +175,17 @@ var ControlPanel = Widget.extend({
* @param {Boolean} [is_hidden] visibility of the searchview
**/
update_search_view: function(searchview, is_hidden) {
- // Set the $buttons div (in the DOM) of the searchview as the $buttons
- // have been appended to a jQuery node not in the DOM at SearchView initialization
- searchview.$buttons = this.nodes.$searchview_buttons;
- searchview.toggle_visibility(!is_hidden);
- this.$title_col.toggleClass('col-md-6', !is_hidden).toggleClass('col-md-12', is_hidden);
+ if (searchview) {
+ // Set the $buttons div (in the DOM) of the searchview as the $buttons
+ // have been appended to a jQuery node not in the DOM at SearchView initialization
+ searchview.$buttons = this.nodes.$searchview_buttons;
+ searchview.toggle_visibility(!is_hidden);
+ this.$title_col.toggleClass('col-md-6', !is_hidden).toggleClass('col-md-12', is_hidden);
+ } else {
+ // Show the searchview buttons area, which might have been hidden by
+ // the searchview, as client actions may insert elements into it
+ this.nodes.$searchview_buttons.show();
+ }
},
});