From 606c96e75365964a2c899ccf2e4bba82143448da Mon Sep 17 00:00:00 2001 From: Benjamin Vray Date: Thu, 9 Dec 2021 10:02:05 +0000 Subject: [PATCH] [FIX] website_livechat: fix chat button popover on touchscreen device Before this commit, on touchscreen device, when we clicked on the livechat button, the popover remained visible over the chat window. After this commit, the popover is never displayed on touchscreen devices to avoid this bug but also because it makes no sense to have a popover on touchscreen devices in this case. task-2677132 closes odoo/odoo#81151 X-original-commit: 556168efd20727e044a9825435cdc887821a4f80 Signed-off-by: Quentin Smetz (qsm) --- addons/website_livechat/static/src/legacy/public_livechat.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/website_livechat/static/src/legacy/public_livechat.js b/addons/website_livechat/static/src/legacy/public_livechat.js index 107e5c25985..ad0e984d4fd 100644 --- a/addons/website_livechat/static/src/legacy/public_livechat.js +++ b/addons/website_livechat/static/src/legacy/public_livechat.js @@ -4,6 +4,7 @@ odoo.define('website_livechat.legacy.website_livechat.livechat_request', functio var utils = require('web.utils'); var session = require('web.session'); var LivechatButton = require('im_livechat.legacy.im_livechat.im_livechat').LivechatButton; +const config = require('web.config'); LivechatButton.include({ @@ -32,7 +33,7 @@ LivechatButton.include({ $(window).trigger('resize'); await this._super(...arguments); this.el.innerHTML = ""; - if (this.options.button_text) { + if (this.options.button_text && !config.device.touch) { this.el.dataset.content = this.options.button_text; this.el.dataset.toggle = "popover"; this.el.dataset.trigger = "hover";