From 953b03d086e0d026171c80f374d93ea76bb7fa38 Mon Sep 17 00:00:00 2001 From: Steffen van Bergerem Date: Sat, 12 Sep 2015 14:52:18 +0200 Subject: [PATCH] Fix adding the first comment in the mobile view --- app/assets/javascripts/mobile/mobile_comments.js | 8 +++++--- features/mobile/reactions.feature | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/mobile/mobile_comments.js b/app/assets/javascripts/mobile/mobile_comments.js index 3e6300b5f..189b43f4b 100644 --- a/app/assets/javascripts/mobile/mobile_comments.js +++ b/app/assets/javascripts/mobile/mobile_comments.js @@ -146,9 +146,11 @@ }, addNewComments: function(bottomBar, data) { - var commentsContainer = bottomBar.find(".comment_container").first(); - var comments = commentsContainer.find(".comments").first(); - comments.append(data); + if ($(".comment_container", bottomBar).length === 0) { + $(".show_comments", bottomBar).after($("
", {"class": "comment_container"})); + $(".comment_container", bottomBar).append($("