mirror of
https://github.com/diaspora/diaspora.git
synced 2026-01-09 15:18:11 -05:00
Enabled likes-on-comments in mobile view
This commit is contained in:
committed by
Benjamin Neff
parent
35f1cd61b1
commit
06a0dc68a9
@@ -75,8 +75,8 @@
|
||||
|
||||
onLike: function(evt){
|
||||
evt.preventDefault();
|
||||
var link = $(evt.target).closest(".like-action"),
|
||||
likeCounter = $(evt.target).closest(".stream-element").find(".like-count");
|
||||
var link = $(evt.target).closest(".like-action").first(),
|
||||
likeCounter = $(evt.target).find(".like-count").first();
|
||||
|
||||
if(!link.hasClass("loading") && link.hasClass("inactive")) {
|
||||
Diaspora.Mobile.PostActions.like(likeCounter, link);
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
.comments > .comment,
|
||||
.comment.new-comment-form-wrapper {
|
||||
|
||||
|
||||
margin: 0;
|
||||
border-top: 1px dotted $border-grey;
|
||||
padding: 10px 0;
|
||||
|
||||
@@ -71,12 +71,21 @@
|
||||
.entypo-heart.active { color: $red; }
|
||||
}
|
||||
|
||||
.comment-stats {
|
||||
@extend .post-stats;
|
||||
bottom: 25px;
|
||||
}
|
||||
|
||||
.post-action {
|
||||
display: flex;
|
||||
margin: 0 7px;
|
||||
|
||||
.disabled { color: $medium-gray; }
|
||||
}
|
||||
|
||||
.comment-action {
|
||||
@extend .post-action;
|
||||
}
|
||||
|
||||
.add-comment-switcher { padding-top: 10px; }
|
||||
|
||||
|
||||
@@ -39,6 +39,21 @@ module MobileHelper
|
||||
end
|
||||
end
|
||||
|
||||
def mobile_like_comment_icon(comment)
|
||||
puts "Mobile like on comment!"
|
||||
if current_user && current_user.liked?(comment)
|
||||
link_to content_tag(:span, comment.likes.size, class: "count like-count"),
|
||||
"#",
|
||||
data: {url: comment_like_path(comment.id, current_user.like_for(comment).id)},
|
||||
class: "entypo-heart like-action active"
|
||||
else
|
||||
link_to content_tag(:span, comment.likes.size, class: "count like-count"),
|
||||
"#",
|
||||
data: {url: comment_likes_path(comment.id)},
|
||||
class: "entypo-heart like-action inactive"
|
||||
end
|
||||
end
|
||||
|
||||
def mobile_comment_icon(post)
|
||||
link_to content_tag(:span, post.comments.size, class: "count comment-count"),
|
||||
new_post_comment_path(post),
|
||||
|
||||
@@ -21,3 +21,6 @@
|
||||
|
||||
%div{class: direction_for(comment.text)}
|
||||
= comment.message.markdownified
|
||||
.comment-stats
|
||||
.comment-action
|
||||
= mobile_like_comment_icon(comment)
|
||||
|
||||
Reference in New Issue
Block a user