 
   updateMessage: ->
 
-    console.log "update message"
+    @setState editMode: no
+    messageBody = @refs.EditMessageTextarea.getDOMNode().value
+    ActivityFlux.actions.message.editMessage @props.message.get('id'), messageBody
 
 
   cancelEdit: ->

          </div>
        </div>
        <div className={editFormClass}>
          <textarea onKeyDown = { @bound 'handleEditMessageKeyDown' } defaultValue={ message.get 'body' }></textarea>
          <button className="solid green done-button" type="button" onClick={@bound 'updateMessage'} >DONE</button>
          <button className="cancel-editing" type="button" onClick={@bound 'cancelEdit'} >CANCEL</button>
        </div>


  getMenuItems: ->
    return [
      {title: 'Edit Post',          key: 'editpost',    onClick: @bound 'editPost'}
      {title: 'Delete Post',        key: 'deletepost',  onClick: @bound 'deletePost'}
      {title: 'Mark User as Troll', key: 'markuser',    onClick: @bound 'markUser'}
      {title: 'Block User',         key: 'blockuser',   onClick: @bound 'blockUser'}
      {title: 'impersonate User',   key: 'impersonate', onClick: @bound 'impersonate'}
    ]


  getDeleteItemModalProps: ->
    className          : 'activityDeleteItemModal'
    title              : 'Delete post'
    body               : 'Are you sure you want to delete this post?'
    buttonYESText      : 'DELETE'
    buttonNOText       : 'CANCEL'
    buttonYESHandler   : @bound 'deletePostButtonHandler'
    buttonNOHandler    : @bound 'closeDeletePostModal'
    buttonCloseHandler : @bound 'closeDeletePostModal'


  deletePostButtonHandler: ->

    ActivityFlux.actions.message.removeMessage @props.message.get('id')
    @closeDeletePostModal()


  closeDeletePostModal: ->

    @modalContainer.classList.add 'hidden'


  editPost: ->
