     $('#edit-contact-form').submit   => this.updateContact()
 
     $('#container').fadeIn 200
-    layout = this.resize()
-
-    fn = ->
-      layout.resize()
-      layout.resize() # not sure why two are needed
+    @layout = this.resize()
+
+    fn = =>
+      @layout.resize()
+      @layout.resize() # not sure why two are needed
 
     new Filter
       list: '#roster'

    @session.onPresence (p) => this.presence(p)
    @chats = {}
    @currentContact = null

  datef: (millis) ->
    d = new Date(millis)

      fn() if fn
      form.fadeIn 100
    else
      form.fadeOut 100, =>
        form[0].reset()
        @layout.resize()
        fn() if fn

  draw: ->
