From e503b0b3a4a521ae9f36e4c6e151bc7b80938b92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20K=C3=BChn?= Date: Fri, 22 Jun 2018 16:23:02 +0200 Subject: [PATCH] [FIX] im_support: fix style of attachment button in discuss composer Before this commit, there was a visual bug on the attachment button of a composer in discuss: instead of being next to the emoji button, it was places below it. This is due to the intent of displaying the attachment button only for threads that are not the support channel. To do so, it uses the jQuery methods `$.show()` and `$.hide()` on the considered DOM element. The problem is that these methods change the `display` attribute of the DOM element, so that when `$.show()` is called, it sets the display to `block`, which causes the visual glitch. With this commit, we use the classname `o_hidden` instead of the jQuery methods, so that the attribute `display` is unchanged. --- addons/im_support/static/src/js/discuss.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/im_support/static/src/js/discuss.js b/addons/im_support/static/src/js/discuss.js index df2526a2a26..0f29370b049 100644 --- a/addons/im_support/static/src/js/discuss.js +++ b/addons/im_support/static/src/js/discuss.js @@ -42,9 +42,9 @@ Discuss.include({ if (!channel.available) { self.basicComposer.do_hide(); } - $buttonAddAttachment.hide(); + $buttonAddAttachment.toggleClass('o_hidden', true); } else { - $buttonAddAttachment.show(); + $buttonAddAttachment.toggleClass('o_hidden', false); } }); },