Skip to content

Commit

Permalink
Merge pull request #546 from zooniverse/scroll-to-linked-comments
Browse files Browse the repository at this point in the history
Scroll to comments if being linked to
  • Loading branch information
brian-c committed Jun 12, 2015
2 parents ddee887 + e27e83b commit 3699c52
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/talk/comment.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module?.exports = React.createClass
onDeleteComment: React.PropTypes.func # passed (commentId) on click
onLikeComment: React.PropTypes.func # passed (commentId) on like
onClickReply: React.PropTypes.func # passed (user, comment) on click
active: React.PropTypes.bool # optional active switch
active: React.PropTypes.bool # optional active switch: scroll window to comment and apply styling

getDefaultProps: ->
active: false
Expand All @@ -37,6 +37,10 @@ module?.exports = React.createClass
editing: false
commentValidationErrors: []

componentDidMount: ->
if @props.active
React.findDOMNode(@).scrollIntoView()

onClickReply: (e) ->
@props.onClickReply(@props.user, @props.data)

Expand Down

0 comments on commit 3699c52

Please sign in to comment.