diff options
| author | Alexandre Kühn <aku@odoo.com> | 2018-03-21 14:20:01 +0100 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2018-04-11 14:52:56 +0200 |
| commit | ea25036c148e04c3d1de2ec1e13059b98200f7a3 (patch) | |
| tree | e1e4abb0a86cf560829bc46deb738a15cc34b46b /addons/web/static/src/js/views/abstract_controller.js | |
| parent | c471ca22befd6c80f82ba1984839e781393e5a8e (diff) | |
[FIX] web: graph rendering when in DOM
Backported fixes:
1. [IMP] web: GraphView: remove hack to render in DOM
- ref. 166319fa4a31c0105d786c1e8b8d0228ff45bd14
- fully backported.
This commit backports the fix that removes the hack for rendering graphs
(delay in a setTimeout), so that the graph is rendered when it is in the DOM.
2. [IMP] web: restore scroll position
- ref. 4e204ed2233ccd36b2eb7d3e56bfa741b9cb3e14
- partially backported: only keeps `on_attach_callback`
and `on_detach_callback` in the abstract_controller
and in the abstract_renderer.
This commit backports the use of the hooks methods `on_attach_callback` and
`on_detach_callback` in abstract controller and renderer, so that the
controller of any view warns the renderer when it has been attached in
(or detach from) the DOM.
Also, this commit adds `on_attach_callback` and `on_detach_callback` for the
dashboard app, so that the graph view is correctly rendered.
Fixes #24092
Diffstat (limited to 'addons/web/static/src/js/views/abstract_controller.js')
| -rw-r--r-- | addons/web/static/src/js/views/abstract_controller.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/addons/web/static/src/js/views/abstract_controller.js b/addons/web/static/src/js/views/abstract_controller.js index 3bdf8ab08ca..6a3f9a3bbaa 100644 --- a/addons/web/static/src/js/views/abstract_controller.js +++ b/addons/web/static/src/js/views/abstract_controller.js @@ -62,6 +62,18 @@ var AbstractController = Widget.extend({ } return this._super.apply(this, arguments); }, + /** + * Called each time the controller is attached into the DOM. + */ + on_attach_callback: function () { + this.renderer.on_attach_callback(); + }, + /** + * Called each time the controller is detached from the DOM. + */ + on_detach_callback: function () { + this.renderer.on_detach_callback(); + }, //-------------------------------------------------------------------------- // Public |
