From b58226ba9ab40f1eb53c91af308dec4547ed7da3 Mon Sep 17 00:00:00 2001 From: Steffen van Bergerem Date: Mon, 9 Jan 2017 01:13:34 +0100 Subject: [PATCH] Load comments in mobile view when clicking comment button closes #7207 --- Changelog.md | 1 + app/assets/javascripts/mobile/mobile_comments.js | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 9cbe3091b..ff5610316 100644 --- a/Changelog.md +++ b/Changelog.md @@ -3,6 +3,7 @@ ## Refactor * Increase the spacing above and below post contents [#7267](https://github.com/diaspora/diaspora/pull/7267) * Replace fileuploader-custom with FineUploader [#7083](https://github.com/diaspora/diaspora/pull/7083) +* Always show mobile reaction counts [#7207](https://github.com/diaspora/diaspora/pull/7207) ## Bug fixes * Fix background color of year on notifications page with dark theme [#7263](https://github.com/diaspora/diaspora/pull/7263) diff --git a/app/assets/javascripts/mobile/mobile_comments.js b/app/assets/javascripts/mobile/mobile_comments.js index d680d5dd9..55fdfb44d 100644 --- a/app/assets/javascripts/mobile/mobile_comments.js +++ b/app/assets/javascripts/mobile/mobile_comments.js @@ -18,8 +18,19 @@ this.stream().on("tap click", "a.comment-action", function(evt) { evt.preventDefault(); - self.showCommentBox($(this)); var bottomBar = $(this).closest(".bottom-bar").first(); + var toggleReactionsLink = bottomBar.find("a.show-comments").first(); + + if (toggleReactionsLink.length === 0) { + self.showCommentBox($(this)); + } else { + if (toggleReactionsLink.hasClass("loading")) { + return; + } + if (!toggleReactionsLink.hasClass("active")) { + self.showComments(toggleReactionsLink); + } + } var commentContainer = bottomBar.find(".comment-container").first(); self.scrollToOffset(commentContainer); });