 
     
 Template.messages.rendered = ->
-    console.log("render template messages")
+    #console.log("render template messages")
     #_.once ->
     setMessageListHeight()
     scrollToBottom()
     hideSpinner()
     
 Template.messagesList.created = ->
-    console.log("created template messagesList")
+    #console.log("created template messagesList")
     scrollToBottomOK = true
 
 Template.messagesList.rendered = ->
-    console.log("render template messagesList")
+    #console.log("render template messagesList")
     # Note: messages.rendered should be called after this...
     #scrollToBottom()
     #hideSpinner()

Template.messagesList.events
    'scroll .messages-list-box': (e) ->
        if MessagesHandle.ready() and Messages.find().count() > MessagesHandle.loaded()
            console.log("scroll:" + $('.messages-list-box').scrollTop())
            if $('.messages-list-box').scrollTop() == 0
                $('#small-spinner').fadeTo(100, 1)
                Meteor.defer ->

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

