From 13c997a5c85596ec862faeb60c84b1a71f3d2c66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauris=20Buk=C5=A1is-Haberkorns?= Date: Tue, 5 Dec 2017 22:54:27 +0200 Subject: [PATCH] Fix reaction possition when there is attachments --- public/js/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/public/js/index.js b/public/js/index.js index c56030f34910a..28377ce23157e 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -151,7 +151,13 @@ function initReactionSelector(parent) { react.remove(); } if (!resp.empty) { - react = $('
').appendTo(content); + react = $('
'); + var attachments = content.find('.segment.bottom:first'); + if (attachments.length > 0) { + react.insertBefore(attachments); + } else { + react.appendTo(content); + } react.html(resp.html); var hasEmoji = react.find('.has-emoji'); for (var i = 0; i < hasEmoji.length; i++) {