summaryrefslogtreecommitdiff
path: root/addons/mail
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2018-01-04 16:17:14 +0100
committerAaron Bohy <aab@odoo.com>2018-01-26 19:26:03 +0100
commitcf178a2f068acd4b4c4fc2cda00b6ef8f6dc79c0 (patch)
tree8cc09ab6d4d81619654c008058f5b28874eae150 /addons/mail
parentcb339842d4d8b19f3870127c00a6868af2e95004 (diff)
[IMP] web,*: config: add XXS size to config.device
In Less, the size_class XXS is defined and used in media queries. This rev. adds it in JS for sake of consistency. Code in addons comparing the size_class needed to be adapted due to the new XXS size_class. Moreover, we now use the helper 'config.device.isMobile' everywhere we should, instead of manually comparing the size_class. Finally, we changed the way the config.device has to be specified in the test environment. From now on, only the size_class should be set, and the isMobile flag is computed automatically.
Diffstat (limited to 'addons/mail')
-rw-r--r--addons/mail/static/src/js/chat_window.js2
-rw-r--r--addons/mail/static/src/js/window_manager.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/addons/mail/static/src/js/chat_window.js b/addons/mail/static/src/js/chat_window.js
index 0c3a2270045..c8cfecd193f 100644
--- a/addons/mail/static/src/js/chat_window.js
+++ b/addons/mail/static/src/js/chat_window.js
@@ -150,7 +150,7 @@ return Widget.extend({
this.trigger("close_chat_session");
},
on_click_fold: function () {
- if (config.device.size_class !== config.device.SIZES.XS) {
+ if (!config.device.isMobile) {
this.toggle_fold();
this.trigger("fold_channel", this.channel_id, this.folded);
}
diff --git a/addons/mail/static/src/js/window_manager.js b/addons/mail/static/src/js/window_manager.js
index 28bf4ad71e9..147a3762068 100644
--- a/addons/mail/static/src/js/window_manager.js
+++ b/addons/mail/static/src/js/window_manager.js
@@ -193,7 +193,7 @@ function toggle_fold_chat (channel) {
}
function compute_available_slots (nb_windows) {
- if (config.device.size_class === config.device.SIZES.XS) {
+ if (config.device.isMobile) {
display_state.nb_slots = 1; // one chat window full screen in mobile
return;
}