summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/view_manager.js
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2016-02-26 15:42:53 +0100
committerAaron Bohy <aab@odoo.com>2016-02-29 08:47:20 +0100
commitb816cdbea95732718e68b060303bdd4b3313bbe1 (patch)
tree9e6336837379091790a72a50ed872b2b76a582f7 /addons/web/static/src/js/view_manager.js
parente189352d8dbbf4aaf0e13ffc09b23fb12a762769 (diff)
[FIX] web(_*): views: render action buttons in dialogs
Commit 516b1a6c72dde46f3f0c7d4f86a9b8265b4153a1 fixes a bug with action buttons not being displayed when they should in dialogs. However, it makes the assumption that either $node or this.options.$buttons exist, which is not always the case (e.g. dashboard). This rev. moves that logic out of the views to the view_manager, and protects the call of empty() on this.options.$buttons.
Diffstat (limited to 'addons/web/static/src/js/view_manager.js')
-rw-r--r--addons/web/static/src/js/view_manager.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/web/static/src/js/view_manager.js b/addons/web/static/src/js/view_manager.js
index 2ae53aabb22..6d9abc2bc9a 100644
--- a/addons/web/static/src/js/view_manager.js
+++ b/addons/web/static/src/js/view_manager.js
@@ -293,15 +293,16 @@ var ViewManager = Widget.extend(ControlPanelMixin, {
render_view_control_elements: function() {
if (!this.active_view.control_elements) {
var view_controller = this.active_view.controller;
+ var $buttons = this.flags.$buttons;
var elements = {};
if (!this.flags.headless) {
elements = {
- $buttons: !this.flags.footer_to_buttons ? $("<div>") : undefined,
+ $buttons: $("<div>"),
$sidebar: $("<div>"),
$pager: $("<div>"),
};
}
- view_controller.render_buttons(elements.$buttons);
+ view_controller.render_buttons($buttons ? $buttons.empty() : elements.$buttons);
view_controller.render_sidebar(elements.$sidebar);
view_controller.render_pager(elements.$pager);
// Remove the unnecessary outer div