Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scroll to comments if being linked to #546

Merged
merged 1 commit into from
Jun 12, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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