     @swappable.swapViews()
 
   cancelItem:->
-    @getData().key = @form.keyTextarea.getValue()
-    if @getData().key
-      @swappable.swapViews()
-    else
-      @deleteItem()
+    {key} = @getData()
+    if key then @swappable.swapViews() else @deleteItem()
 
   deleteItem:->
     @getDelegate().emit "RemoveItem", @

    @domElement = $ "<li class='kdview clearfix #{cssClass}'></li>"

  viewAppended:->
    super
    @form = form = new AccountSshKeyForm
      delegate : this
      cssClass : "posrelative"
    , @getData()

    @info = info = new KDCustomHTMLView
      tagName  : "span"

    super options,data

class AccountSshKeyForm extends KDFormView

  constructor:->

    super

    @titleLabel = new KDLabelView
      for      : "sshtitle"
      title    : "Label"

    @titleInput = new KDInputView
      placeholder  : "Label your SSH key here..."
      name         : "sshtitle"
      label        : @titleLabel

    @keyTextLabel = new KDLabelView
      for      : "sshkey"
      title    : "SSH Key"

    @keyTextarea = new KDInputView
      placeholder  : "Paste your SSH key here..."
      type         : "textarea"
      name         : "sshkey"
      cssClass     : "light"
      label        : @keyTextLabel

  viewAppended:->

    @addSubView formline1 = new KDCustomHTMLView
      tagName : "div"
      cssClass : "formline"

    formline1.addSubView @titleLabel
    formline1.addSubView @titleInput
    formline1.addSubView @keyTextLabel
    formline1.addSubView @keyTextarea

    @addSubView formline2 = new KDCustomHTMLView
      cssClass : "button-holder"
