                   onClick: @post
 
 
-  setTimestamp: (e) ->
+  setTimestamp: (e) =>
     @setState timestamp: e.currentTarget.value
 
 
-  setMessage: (e) ->
+  setMessage: (e) =>
     if @props.mode == 'timeline'
       callback = @parseTimestamp
 
     @setState message: e.currentTarget.value, callback
 
 
-  post: (e) ->
+  post: (e) =>
     return unless @validPost()
 
     @postXhr?.abort()


bn = 'beatmap-discussion-new'

BeatmapDiscussions.NewDiscussion = React.createClass
  mixins: [React.addons.PureRenderMixin]


  getInitialState: ->
    message: ''
    timestamp: null


  componentDidMount: ->
    @throttledPost = _.throttle @post, 1000


  componentWillUnmount: ->
    @postXhr?.abort()
    @throttledPost.cancel()


  render: ->
    div
      className: 'osu-page osu-page--small'
      div

        onClick: @post


  validPost: =>
    return false if @state.message.length == 0

    if @props.mode == 'timeline'
