[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) <qsm@odoo.com>
This commit is contained in:
Benjamin Vray
2021-12-09 18:40:45 +00:00
parent ea650d80b8
commit 606c96e753
@@ -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";