             name = '' if not name?
             window.document.title = "Cozy - #{name}"
             $("#current-application").html name
-            @resetLayoutSizes()
+            #@resetLayoutSizes()
 
             @$("#app-btn-#{slug} .spinner").hide()
             @$("#app-btn-#{slug} .icon").show()
 
 
         if frame.length is 0
-            frame = @createApplicationIframe(slug, hash)
+            frame = @createApplicationIframe slug, hash
+
+            # We show frames right now because to load properly the app
+            # requires a proper height.
+            @frames.show()
+
+            # Then we hide the frames by moving them far.
+            @frames.css 'top', '-9999px'
+            @frames.css 'left', '-9999px'
+            @frames.css 'position', 'absolute'
+
             frame.on 'load', onLoad
 
         # if the app was already open, we want to change its hash


        frame = @$("##{slug}-frame")
        onLoad = =>
            @frames.show()
            @content.hide()
            @backButton.show()


            app?.routers.main.navigate "/apps/#{slug}/#{newhash}", false

            # Ugly trick required because some app state changes requires
            # to redraw the iframe.
            @resetLayoutSizes()

    ### Configuration ###

    # Small trick to size properly iframe.
    resetLayoutSizes: =>
        # Ugly trick to for redrawing of iframes.
        @frames.find('iframe').height "99%"
        setTimeout =>
