     @buttons[defaultFocusTitle].setFocus()  unless focused
 
   click:(e)->
-    @destroy() if $(e.target).is(".closeModal")
+    @cancel() if $(e.target).is(".closeModal")
     # @getSingleton("windowController").setKeyView @ ---------> disabled because KDEnterinputView was not working in KDmodal
 
-  keyUp:(e)->
-    @destroy() if e.which is 27
+  # keyUp:(e)->
+  #   @cancel() if e.which is 27
 
   setTitle:(title)->
     @$().find(".kdmodal-title").removeClass('hidden').html("<span class='title'>#{title}</span>")


    # @getSingleton("windowController").setKeyView @ ---------> disabled because KDEnterinputView was not working in KDmodal
    $(window).one "keydown.modal",(e)=>
      @destroy() if e.which is 27

    @on "childAppended", @setPositions.bind @


      @utils.wait =>
        @setClass "active"

  cancel:->
    @emit 'ModalCancelled'
    @destroy()

  destroy:()->
    $(window).off "keydown.modal"
    uber = KDView::destroy.bind(@)
