From 4e204ed2233ccd36b2eb7d3e56bfa741b9cb3e14 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Thu, 8 Mar 2018 14:57:43 +0100 Subject: [IMP] web: restore scroll position This rev. improves the way the scroll position is restored when coming back to a view (e.g. open a kanban view, scroll, click on a record to open it in a form view, go back to kanban using the breadcrumbs): - generalize the scroll position handling from web_enterprise to web to make it available in the community webclient as well - also restore left scroll position, not only top (especially useful for grouped Kanban views with a lot of columns) - handle the case where the scrolling area is a sub element of the view (e.g. the grouped Kanban view in mobile). Task 34037 Co-authored-by: Mohammed Shekha Co-authored-by: Ankit Sathvara --- addons/web/static/src/js/views/abstract_controller.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'addons/web/static/src/js/views/abstract_controller.js') diff --git a/addons/web/static/src/js/views/abstract_controller.js b/addons/web/static/src/js/views/abstract_controller.js index 995a5102c37..ee39fd95596 100644 --- a/addons/web/static/src/js/views/abstract_controller.js +++ b/addons/web/static/src/js/views/abstract_controller.js @@ -102,6 +102,18 @@ var AbstractController = AbstractAction.extend(ControlPanelMixin, { } 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 -- cgit v1.2.3