From 77df0bc82cd34d9252bb5a21c4cf025591c8c7c6 Mon Sep 17 00:00:00 2001 From: zmagod Date: Mon, 3 Oct 2016 12:34:16 +0200 Subject: [PATCH] cleans more comment link --- app/assets/javascripts/comments.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/comments.js b/app/assets/javascripts/comments.js index 7d8e75ba3..930e28d33 100644 --- a/app/assets/javascripts/comments.js +++ b/app/assets/javascripts/comments.js @@ -54,12 +54,6 @@ var Comments = (function() { var list = $(this).parents('ul'); var moreBtn = list.find('.btn-more-comments'); var listItem = moreBtn.parents('li'); - // removes duplicated dates - if ( list.find($('.comment-date-separator')) - .first().find('p').text() === - $(data.html).first().find('p').text() ) { - list.find($('.comment-date-separator'))[0].remove(); - } $(data.html).insertAfter(listItem); if (data.resultsNumber < data.perPage) { @@ -73,6 +67,8 @@ var Comments = (function() { scrollCommentOptions(listItem .closest('.content-comments') .find('.dropdown-comment')); + } else { + $('.btn-more-comments').remove(); } }); }