diff options
| author | Julien Mougenot <jum@odoo.com> | 2020-03-11 09:38:28 +0000 |
|---|---|---|
| committer | Julien Mougenot <jum@odoo.com> | 2020-03-13 14:08:33 +0000 |
| commit | 18e5416636b19b0953b1e6e26bfaeab1ebecce4c (patch) | |
| tree | 5be75af26f1707a5b8b2184545719f3628d2980f /addons/web/static/src/js/views/qweb | |
| parent | fbf347498f1cc7b74ef373179b7bcae201715c24 (diff) | |
[REF] web: Adapt views/actions to new control panel
Some web actions/controllers/viewsl have been adapted to properly instantiate the
newly refactored control panel and update it accordingly. We needed to adapt the
starting mechanism of actions and controllers to ensure that the control panel
instantiation did not delay the loading of any widget.
Part of task 2196029
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/views/qweb')
| -rw-r--r-- | addons/web/static/src/js/views/qweb/qweb_view.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/addons/web/static/src/js/views/qweb/qweb_view.js b/addons/web/static/src/js/views/qweb/qweb_view.js index 0c858b5eb6c..21ad867c286 100644 --- a/addons/web/static/src/js/views/qweb/qweb_view.js +++ b/addons/web/static/src/js/views/qweb/qweb_view.js @@ -91,16 +91,21 @@ var Renderer = AbstractRenderer.extend({ var Controller = AbstractController.extend({ events: _.extend({}, AbstractController.prototype.events, { 'click [type="toggle"]': '_onLazyToggle', + 'click [type="action"]' : '_onActionClicked', }), init: function () { this._super.apply(this, arguments); - this._$buttons = $('<nav>').on('click', '[type="action"]', this.proxy('_onActionClicked')); }, + /** + * @override + */ renderButtons: function ($node) { - this._super($node); - $node.append(this._$buttons); + this.$buttons = $('<nav/>'); + if ($node) { + $node.append(this.$buttons); + } }, _update: function () { var self = this; @@ -108,7 +113,7 @@ var Controller = AbstractController.extend({ // move control panel buttons from the view to the control panel // area var $cp_buttons = self.renderer.$('nav.o_qweb_cp_buttons'); - $cp_buttons.children().appendTo(self._$buttons.empty()); + $cp_buttons.children().appendTo(self.$buttons.empty()); $cp_buttons.remove(); }); }, |
