 
     KD.getSingleton('router').clear @getRouteWithEntryPoint 'Register'
     $('body').removeClass 'recovery'
-    @show =>
-      @animateToForm "register"
-      @$('.flex-wrapper').addClass 'taller'
-      KD.getSingleton('mainController').emit 'InvitationReceived', invite
-
-  hide:(callback)->
+    @animateToForm "register"
+    @$('.flex-wrapper').addClass 'taller'
+    KD.getSingleton('mainController').emit 'InvitationReceived', invite
+
+
+  hide: (callback) ->
 
     @$('.flex-wrapper').removeClass 'expanded'
     @emit "LoginViewHidden"
     @setClass 'hidden'
     callback?()
 
-  show:(callback)->
+
+  show: (callback) ->
 
     @unsetClass 'hidden'
     @emit "LoginViewShown"
-    @hidden = no
     callback?()
 
   # click:(event)->


  constructor:(options = {}, data)->

    {entryPoint} = KD.config
    options.cssClass = 'hidden'

    super options, data

    @setCss 'background-image', "url('../a/images/unsplash/#{backgroundImageNr}.jpg')"

    @hidden = yes

    handler =(route, event)=>
      stop event
      KD.getSingleton('router').handleRoute route, {entryPoint}

    homeHandler     = handler.bind null, '/'
    loginHandler    = handler.bind null, '/Login'
    registerHandler = handler.bind null, '/Register'
    recoverHandler  = handler.bind null, '/Recover'

    @logo = new KDCustomHTMLView
      tagName   : "a"
      cssClass  : "koding-logo"
      partial   : '<cite></cite>'
      click     : (event)->
        KD.utils.stopDOMEvent event
        homeHandler()

    @backToLoginLink = new KDCustomHTMLView
      tagName     : "a"
      partial     : "Sign In"
      click       : ->
        KD.mixpanel "Login button form in /Login, click"
        loginHandler()


    @goToRecoverLink = new KDCustomHTMLView
      tagName     : "a"
      cssClass    : "forgot-link"
      partial     : "Forgot your password?"
      testPath    : "landing-recover-password"
      click       : recoverHandler

    @goToRegisterLink = new KDCustomHTMLView
      tagName     : "a"
      partial     : "Sign up"
      click       : ->
        KD.mixpanel "Register button form in /Login, click"
        registerHandler()

    @formHeader      = new KDCustomHTMLView
      tagName     : "h4"
      cssClass    : "form-header"

    if KD.utils.oauthEnabled() is yes
      @github          = new KDCustomHTMLView

        content    : ""
        closeTimer : 4000
        container  : this

    KD.utils.defer => @setClass 'shown'

  pistachio:->
      # {{> @loginOptions}}
