summaryrefslogtreecommitdiff
path: root/addons/web/static
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static')
-rw-r--r--addons/web/static/src/js/chrome/abstract_web_client.js27
-rw-r--r--addons/web/static/src/js/chrome/action_manager.js2
2 files changed, 20 insertions, 9 deletions
diff --git a/addons/web/static/src/js/chrome/abstract_web_client.js b/addons/web/static/src/js/chrome/abstract_web_client.js
index 7c48784bd39..0cabba1d23d 100644
--- a/addons/web/static/src/js/chrome/abstract_web_client.js
+++ b/addons/web/static/src/js/chrome/abstract_web_client.js
@@ -89,6 +89,7 @@ var AbstractWebClient = Widget.extend(KeyboardNavigationMixin, {
getScrollPosition: '_onGetScrollPosition',
scrollTo: '_onScrollTo',
set_title_part: '_onSetTitlePart',
+ webclient_started: '_onWebClientStarted',
},
init: function (parent) {
// a flag to determine that odoo is fully loaded
@@ -155,14 +156,6 @@ var AbstractWebClient = Widget.extend(KeyboardNavigationMixin, {
// though it has no valid session
return Promise.resolve();
}
- }).then(function () {
- // Listen to 'scroll' event and propagate it on main bus
- self.action_manager.$el.on('scroll', core.bus.trigger.bind(core.bus, 'scroll'));
- odoo.isReady = true;
- core.bus.trigger('web_client_ready');
- if (session.uid === 1) {
- self.$el.addClass('o_is_superuser');
- }
});
},
/**
@@ -544,6 +537,24 @@ var AbstractWebClient = Widget.extend(KeyboardNavigationMixin, {
throw new Error('Unknown effect type: ' + type);
}
},
+ /**
+ * Reacts to the end of the loading of the WebClient as a whole
+ * It allows for signalling to the rest of the ecosystem that the interface is usable
+ *
+ * @private
+ */
+ _onWebClientStarted: function() {
+ if (!this.isStarted) {
+ // Listen to 'scroll' event and propagate it on main bus
+ this.action_manager.$el.on('scroll', core.bus.trigger.bind(core.bus, 'scroll'));
+ odoo.isReady = true;
+ core.bus.trigger('web_client_ready');
+ if (session.uid === 1) {
+ this.$el.addClass('o_is_superuser');
+ }
+ this.isStarted = true;
+ }
+ }
});
return AbstractWebClient;
diff --git a/addons/web/static/src/js/chrome/action_manager.js b/addons/web/static/src/js/chrome/action_manager.js
index 92c090827d8..7c6193be6cb 100644
--- a/addons/web/static/src/js/chrome/action_manager.js
+++ b/addons/web/static/src/js/chrome/action_manager.js
@@ -171,7 +171,7 @@ var ActionManager = Widget.extend({
return action;
});
}).then(function(action) {
- odoo.isReady = true;
+ self.trigger_up('webclient_started');
return action;
});
},