summaryrefslogtreecommitdiff
path: root/addons/mail/static/src
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2018-08-10 15:37:17 +0200
committerMartin Trigaux <mat@odoo.com>2018-08-10 16:32:50 +0200
commitf7130556bbcbc0a0b93ba07ef1da9c9d11b68b54 (patch)
tree33a455e6ad8219595b8fcb786e88d44cc1d60e75 /addons/mail/static/src
parentb6f7ad3adb23fff1aa888d8315aca8157b555b03 (diff)
[REF] *: add support for RTL languages
מזל טוב The direction parameter will now have a real impact on the web interface and completly switch the direction of the interface. Add the dependency rtlcss to switch the direction with a css postprocessor. Two different assets will be generated for ltr or rtl /web/content/<...>/web.assets_backend.0.css and /web/content/<...>/rtl/web.assets_backend.0.css to be able to differentiate it easily Adapt the css and views to be easier to switch direction Render graph as it is, do not move y-axis right side, as per mathematical rule value goes left from origin are considered negative, so keep graph as it is for right to left language add test cases for language direction specific assets bundle if language direction is rtl then we also store css files in assets bundle now we store two assets bundle, one for ltr and one for rtl language direction test two assets bundles generated, also test two assets bundle generated for en_US and ar_SY
Diffstat (limited to 'addons/mail/static/src')
-rw-r--r--addons/mail/static/src/js/services/mail_window_manager.js5
-rw-r--r--addons/mail/static/src/js/thread_windows/abstract_thread_window.js3
-rw-r--r--addons/mail/static/src/scss/abstract_thread_window.scss1
-rw-r--r--addons/mail/static/src/scss/systray.scss1
4 files changed, 8 insertions, 2 deletions
diff --git a/addons/mail/static/src/js/services/mail_window_manager.js b/addons/mail/static/src/js/services/mail_window_manager.js
index d65675c42a7..733ca366a95 100644
--- a/addons/mail/static/src/js/services/mail_window_manager.js
+++ b/addons/mail/static/src/js/services/mail_window_manager.js
@@ -9,6 +9,7 @@ var core = require('web.core');
var utils = require('web.utils');
var QWeb = core.qweb;
+var _t = core._t;
var THREAD_WINDOW_WIDTH = 325 + 5; // 5 pixels between windows
@@ -518,7 +519,9 @@ MailManager.include({
var index = 0;
while (index < count && index < this._threadWindows.length) {
var threadWindow = this._threadWindows[index];
- threadWindow.$el.css({ right: THREAD_WINDOW_WIDTH*index, bottom: 0 });
+ var cssProps = {bottom: 0};
+ cssProps[_t.database.parameters.direction === 'rtl' ? 'left' : 'right'] = THREAD_WINDOW_WIDTH*index;
+ threadWindow.$el.css(cssProps);
threadWindow.do_show();
index++;
}
diff --git a/addons/mail/static/src/js/thread_windows/abstract_thread_window.js b/addons/mail/static/src/js/thread_windows/abstract_thread_window.js
index 5b354ed2aa8..8ec8aa84b31 100644
--- a/addons/mail/static/src/js/thread_windows/abstract_thread_window.js
+++ b/addons/mail/static/src/js/thread_windows/abstract_thread_window.js
@@ -86,7 +86,8 @@ var AbstractThreadWindow = Widget.extend({
this._focusInput();
}
if (!config.device.isMobile) {
- this.$el.css('margin-right', $.position.scrollbarWidth());
+ var margin_dir = _t.database.parameters.direction === "rtl" ? "margin-left" : "margin-right";
+ this.$el.css(margin_dir, $.position.scrollbarWidth());
}
var def = this.threadWidget.replace(this.$('.o_thread_window_content'));
return $.when(this._super(), def);
diff --git a/addons/mail/static/src/scss/abstract_thread_window.scss b/addons/mail/static/src/scss/abstract_thread_window.scss
index 02d41948f12..127b7b8adaf 100644
--- a/addons/mail/static/src/scss/abstract_thread_window.scss
+++ b/addons/mail/static/src/scss/abstract_thread_window.scss
@@ -1,6 +1,7 @@
$o-mail-thread-window-zindex: $zindex-modal + 1 !default;
.o_thread_window {
+ direction: ltr;
display: flex;
flex-flow: column nowrap;
position: fixed;
diff --git a/addons/mail/static/src/scss/systray.scss b/addons/mail/static/src/scss/systray.scss
index 1383d462a38..542e6ded473 100644
--- a/addons/mail/static/src/scss/systray.scss
+++ b/addons/mail/static/src/scss/systray.scss
@@ -27,6 +27,7 @@
font-size: 0.7em;
}
.o_mail_systray_dropdown {
+ direction: ltr;
width: 350px;
padding: 0;