Fix comment socketing
This commit is contained in:
parent
4de2ca9958
commit
a5fd01cc09
3 changed files with 3 additions and 4 deletions
|
|
@ -67,10 +67,9 @@ module SocketsHelper
|
|||
|
||||
if object.is_a? Comment
|
||||
post = object.post
|
||||
action_hash[:comment_id] = object.id
|
||||
action_hash[:comment_guid] = object.guid
|
||||
action_hash[:my_post?] = (post.author.owner_id == uid)
|
||||
action_hash[:post_guid] = post.guid
|
||||
|
||||
end
|
||||
|
||||
if object.is_a? Like
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
%li
|
||||
= comment_toggle( post)
|
||||
|
||||
%ul.comments{:id => post.id, :class => ('loaded' if post.comments.size <= 3)}
|
||||
%ul.comments{:class => ('loaded' if post.comments.size <= 3)}
|
||||
-if post.comments.size > 3 && !comments_expanded
|
||||
= render :partial => 'comments/comment', :collection => post.last_three_comments, :locals => {:post => post}
|
||||
-else
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ var WebSocketReceiver = {
|
|||
WebSocketReceiver.processRetraction(obj.post_id);
|
||||
|
||||
} else if (obj['class']=="comments") {
|
||||
WebSocketReceiver.processComment(obj.post_id, obj.comment_id, obj.html, {
|
||||
WebSocketReceiver.processComment(obj.post_guid, obj.comment_guid, obj.html, {
|
||||
'notification': obj.notification,
|
||||
'mine?': obj['mine?'],
|
||||
'my_post?': obj['my_post?']
|
||||
|
|
|
|||
Loading…
Reference in a new issue