Skip to content

Commit

Permalink
remove underscores
Browse files Browse the repository at this point in the history
  • Loading branch information
jsilvestri committed Feb 29, 2016
1 parent 0f582f2 commit 7a2e40b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions app/assets/javascripts/channels/comments.coffee
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
App.comments = App.cable.subscriptions.create "CommentsChannel",
# Called when the subscription is ready for use on the server
connected: ->
# FIXME: While we wait for cable subscriptions to always be finalized
# before sending messages
# FIXME: While we wait for cable subscriptions to always be finalized before sending messages
setTimeout =>
@followCurrentMessage()
@installPageChangeCallback()
Expand All @@ -18,10 +17,10 @@ App.comments = App.cable.subscriptions.create "CommentsChannel",

# When data is received from the server itself
received: (data) ->
@_commentsDiv().append(data.comment) unless @_userIsCurrentUser(data.comment)
@commentsDiv().append(data.comment) unless @userIsCurrentUser(data.comment)

followCurrentMessage: ->
if messageId = @_commentsDiv().data('message-id')
if messageId = @commentsDiv().data('message-id')
# corresponds to CommentsChannel#follow
@perform 'follow', message_id: messageId
else
Expand All @@ -35,7 +34,7 @@ App.comments = App.cable.subscriptions.create "CommentsChannel",

# Helpers

_userIsCurrentUser: (comment) ->
userIsCurrentUser: (comment) ->
$(comment).attr('data-user-id') is $('meta[name=current-user]').attr('id')

_commentsDiv: -> $("[data-channel='comments']")
commentsDiv: -> $("[data-channel='comments']")

0 comments on commit 7a2e40b

Please sign in to comment.