       newPosition.left = $(window).width() - @modalWidth - position.right - 20 if position.right #20 is the padding FIX
       @$().css newPosition
       @$().css opacity : 1
-      @utils.wait 500, =>
-        @unsetClass "initial"
 
   _windowDidResize:->
     @setPositions()


    super options, data

    @putOverlay options.overlay                   if options.overlay
    @setClass "fx"                                if options.fx
    @setTitle options.title                       if options.title
    @setContent options.content                   if options.content
    @addSubView options.view,".kdmodal-content"   if options.view

    KDView.appendToDOMBody @


    @_windowDidResize()

    # @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 @

    @listenWindowResize()

  setDomElement:(cssClass)->

    @domElement = $ "
    <div class='kdmodal #{cssClass}'>
      <div class='kdmodal-shadow'>
        <div class='kdmodal-inner'>
          <span class='close-icon closeModal'></span>
