       title    : "Done editing"
       callback : @bound "submit"
 
+    @cancel = new KDButtonView
+      cssClass : "solid gray"
+      title    : "Cancel"
+      callback : @bound "cancel"
+
+  cancel: ->
+    @destroy()
+    @emit "ActivityInputCancelled"
+
+  edit: (activity) ->
+    @setData activity
+    content = activity.body.replace /\n/g, "<br>"
+    @input.setContent content, activity
+    @embedBox.loadEmbed activity.link.link_url  if activity.link
+
   viewAppended: ->
     @addSubView @input
     @addSubView @embedBox

      @reset()  unless err
      callback? err

  edit: (activity) ->
    @setData activity
    content = activity.body.replace /\n/g, "<br>"
    @input.setContent content, activity
    @embedBox.loadEmbed activity.link.link_url  if activity.link

  reset: (lock = yes) ->
    @input.setContent ""
    @input.blur()

    @addSubView @notification
    @addSubView @embedBox
    @input.addSubView @submit
    @hide()  unless KD.isLoggedIn()


class ActivityEditWidget extends ActivityInputWidget
  constructor : (options = {}) ->
    options.cssClass = "edit-widget"
    options.destroyOnSubmit = yes

    super options

