         maxHeight -= 10
         $(".messages-list-box").css("max-height", maxHeight + "px")
         messageWidth = $(".message").width() - $(".contact-picture").width() - 30
-        console.log("messageWidth", messageWidth)
+        #console.log("messageWidth", messageWidth)
         $(".message-body").css("max-width", messageWidth + "px")
         #console.log("setMessageListHeight:" + $(".messages-list-box").css("max-height"))
 


    
Template.messages.rendered = ->
    console.log("render template messages")
    #_.once ->
    setMessageListHeight()
    scrollToBottom()
    hideSpinner()
    
Template.messagesList.created = ->
    console.log("created template messagesList")
    scrollToBottomOK = true

Template.messagesList.rendered = ->
    console.log("render template messagesList")
    # Note: messages.rendered should be called after this...
    #scrollToBottom()
    #hideSpinner()

@hideSpinner = ->
    Meteor.defer ->
        if MessagesHandle.ready()
            #console.log("Hide Spinner")
            $('#small-spinner').fadeTo(100, 0)
            if not scrollToBottomOK
                Meteor.defer ->
