summaryrefslogtreecommitdiff
path: root/addons/web_editor/static
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2017-12-21 12:29:50 +0100
committerAlexandre Kühn <alex.e.kuhn@gmail.com>2018-02-01 14:51:58 +0100
commit02ec09cb1c3e2d7bc7968f40c18f2208d7f3f498 (patch)
tree10d91136786b13666e78cfb94b12f1609d6f883d /addons/web_editor/static
parent0cd656b5af38051df3f7d6319e99705150bb1cd8 (diff)
[REF][IMP] *: mail js refactoring
This commit improves the JS code of the mail module, which comes maily from the new coding guidelines and the addition of "JS services". JS services are important objects that do not fit well in the component tree, such as chat_manager or ajax. The benefits of JS services are improved readability of the code, reduced coupling, and more testable modules. In particular, discuss was hard to Summary of the changes: - ClientAction has been renamed into Discuss - Clear instantiation of chatManager - New coding guidelines in most mail modules - JS Services can interact with each other - Chat Manager and Window Manager are services - Window Manager renamed to Chat Window Manager - bus.bus is now encapsulated in Bus Service (a service) - The test infrastructure has been tweaked with JS Services - Chat Mixin has been removed A future improvement would be to translate some 'trigger' into 'trigger_up'.
Diffstat (limited to 'addons/web_editor/static')
-rw-r--r--addons/web_editor/static/src/js/content/body_manager.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/web_editor/static/src/js/content/body_manager.js b/addons/web_editor/static/src/js/content/body_manager.js
index 1ba2d219770..2291aa1d4db 100644
--- a/addons/web_editor/static/src/js/content/body_manager.js
+++ b/addons/web_editor/static/src/js/content/body_manager.js
@@ -1,9 +1,9 @@
odoo.define('web_editor.BodyManager', function (require) {
'use strict';
-var mixins = require('web.mixins');
-var session = require('web.session');
var rootWidget = require('web_editor.root_widget');
+var ServiceProviderMixin = require('web.ServiceProviderMixin');
+var session = require('web.session');
/**
* Element which is designed to be unique and that will be the top-most element
@@ -11,13 +11,13 @@ var rootWidget = require('web_editor.root_widget');
* this Class instance. Its main role will be to retrieve RPC demands from its
* children and handle them.
*/
-var BodyManager = rootWidget.RootWidget.extend(mixins.ServiceProvider, {
+var BodyManager = rootWidget.RootWidget.extend(ServiceProviderMixin, {
/**
* @constructor
*/
init: function () {
- mixins.ServiceProvider.init.call(this);
this._super.apply(this, arguments);
+ ServiceProviderMixin.init.call(this);
},
/**
* @override