From d47ff71e49b42d7cc231f6f2fbf0739e765acf9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sat, 28 Jan 2012 21:48:06 +0100 Subject: [PATCH] Fixing automagically scroll disabler --- file/js/TimWolla.WCF.Chat.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/file/js/TimWolla.WCF.Chat.coffee b/file/js/TimWolla.WCF.Chat.coffee index cbac210..d739f1f 100644 --- a/file/js/TimWolla.WCF.Chat.coffee +++ b/file/js/TimWolla.WCF.Chat.coffee @@ -136,7 +136,8 @@ TimWolla.WCF ?= {} $(this).removeClass('hot') if $(this).data 'status' $('.chatMessageContainer').scrollTop $('.chatMessageContainer ul').height() - + @oldScrollTop = $('.chatMessageContainer').scrollTop() + # Desktop Notifications unless typeof window.webkitNotifications is 'undefined' $('#chatNotify').click (event) -> @@ -237,7 +238,7 @@ TimWolla.WCF ?= {} handleMessages: (messages) -> # Disable scrolling automagically when user manually scrolled unless @oldScrollTop is null - if $('.chatMessageContainer').scrollTop() isnt @oldScrollTop + if $('.chatMessageContainer').scrollTop() < @oldScrollTop if $('#chatAutoscroll').data('status') is 1 $('#chatAutoscroll').click() $('#chatAutoscroll').addClass('hot').fadeOut('slow').fadeIn('slow') @@ -257,7 +258,7 @@ TimWolla.WCF ?= {} # Autoscroll down if $('#chatAutoscroll').data('status') is 1 $('.chatMessageContainer').scrollTop $('.chatMessageContainer ul').height() - @oldScrollTop = $('.chatMessageContainer').scrollTop() + @oldScrollTop = $('.chatMessageContainer').scrollTop() ### # Builds the userlist. #