diff options
| author | Aaron Bohy <aab@odoo.com> | 2018-01-04 16:17:14 +0100 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2018-01-26 19:26:03 +0100 |
| commit | cf178a2f068acd4b4c4fc2cda00b6ef8f6dc79c0 (patch) | |
| tree | 8cc09ab6d4d81619654c008058f5b28874eae150 /addons/im_livechat | |
| parent | cb339842d4d8b19f3870127c00a6868af2e95004 (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/im_livechat')
| -rw-r--r-- | addons/im_livechat/static/src/js/im_livechat.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/addons/im_livechat/static/src/js/im_livechat.js b/addons/im_livechat/static/src/js/im_livechat.js index 10cc5610214..049e88cb23c 100644 --- a/addons/im_livechat/static/src/js/im_livechat.js +++ b/addons/im_livechat/static/src/js/im_livechat.js @@ -78,11 +78,10 @@ var LivechatButton = Widget.extend({ start: function () { this.$el.text(this.options.button_text); - var small_screen = config.device.size_class === config.device.SIZES.XS; if (this.history) { _.each(this.history.reverse(), this.add_message.bind(this)); this.open_chat(); - } else if (!small_screen && this.rule.action === 'auto_popup') { + } else if (!config.device.isMobile && this.rule.action === 'auto_popup') { var auto_popup_cookie = utils.get_cookie('im_livechat_auto_popup'); if (!auto_popup_cookie || JSON.parse(auto_popup_cookie)) { this.auto_popup_timeout = setTimeout(this.open_chat.bind(this), this.rule.auto_popup_timer*1000); |
