             app?.routers.main.navigate "/apps/#{slug}/#{newhash}", false
 
             # Ugly trick required because some app state changes requires
-            # to redraw the iframe
+            # to redraw the iframe.
             @resetLayoutSizes()
 
     ### Configuration ###
 
     # Small trick to size properly iframe.
     resetLayoutSizes: =>
-        @frames.height $(window).height() - 36
-
-        if $(window).width() > 640
-            @content.height $(window).height() - 36
-        else
-            @content.height 100
-            @content.height $(window).height()
-
         # Ugly trick to for redrawing of iframes.
         @frames.find('iframe').height "99%"
         setTimeout =>

            name = '' if not name?
            window.document.title = "Cozy - #{name}"
            $("#current-application").html name
            @resetLayoutSizes()

            @$("#app-btn-#{slug} .spinner").hide()
            @$("#app-btn-#{slug} .icon").show()


        if frame.length is 0
            frame = @createApplicationIframe(slug, hash)
            frame.on 'load', onLoad

        # if the app was already open, we want to change its hash

                name = background.replace '-', '_'
                val = "url('/img/backgrounds/#{name}.jpg')"
            else
                val = "url('/api/backgrounds/#{background}>A/picture.jpg')"

            @content.css 'background-image', val

