From 0de5c1f076d7e7d0e5361e08c810c727bd41d9e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20K=C3=BChn?= Date: Mon, 12 Feb 2018 00:03:22 +0100 Subject: [FIX] web{_site,_editor}: transparent root instance 'root widget' With this commit, any component that needs an instance of the root widget can simply require the module 'root.widget'. Based on the context (backend, frontend, iframe), the real root.widget will resolve to either the webclient, the website root instance, or the iframe root instance. This is desirable in order for the tour_manager to become a child of the root widget, as tours are enabled in any of the above contexts. This commit is a requirement in order to solve an issue with JS services, in which there should be only one service provider at any given time. --- addons/web/static/src/js/chrome/root_widget.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 addons/web/static/src/js/chrome/root_widget.js (limited to 'addons/web/static/src/js/chrome/root_widget.js') diff --git a/addons/web/static/src/js/chrome/root_widget.js b/addons/web/static/src/js/chrome/root_widget.js new file mode 100644 index 00000000000..9cf0515b134 --- /dev/null +++ b/addons/web/static/src/js/chrome/root_widget.js @@ -0,0 +1,7 @@ +odoo.define('root.widget', function (require) { +"use strict"; + +var webClient = require('web.web_client'); + +return webClient; +}); -- cgit v1.2.3