summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/chrome
diff options
context:
space:
mode:
authorAlexandre Kühn <aku@odoo.com>2018-02-12 00:03:22 +0100
committerAlexandre Kühn <aku@odoo.com>2018-02-12 16:09:37 +0100
commit0de5c1f076d7e7d0e5361e08c810c727bd41d9e0 (patch)
tree17bcec2088d56d1f755fb3068ef1d27fe5a71c45 /addons/web/static/src/js/chrome
parentdd610140bf272e21a5c3ba45202bcde8e417cfaa (diff)
[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.
Diffstat (limited to 'addons/web/static/src/js/chrome')
-rw-r--r--addons/web/static/src/js/chrome/root_widget.js7
1 files changed, 7 insertions, 0 deletions
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;
+});