1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-22 21:40:08 +00:00

Fixing automagically scroll disabler

This commit is contained in:
Tim Düsterhus 2012-01-28 21:48:06 +01:00
parent 58484b2ec0
commit d47ff71e49

View File

@ -136,6 +136,7 @@ TimWolla.WCF ?= {}
$(this).removeClass('hot') $(this).removeClass('hot')
if $(this).data 'status' if $(this).data 'status'
$('.chatMessageContainer').scrollTop $('.chatMessageContainer ul').height() $('.chatMessageContainer').scrollTop $('.chatMessageContainer ul').height()
@oldScrollTop = $('.chatMessageContainer').scrollTop()
# Desktop Notifications # Desktop Notifications
unless typeof window.webkitNotifications is 'undefined' unless typeof window.webkitNotifications is 'undefined'
@ -237,7 +238,7 @@ TimWolla.WCF ?= {}
handleMessages: (messages) -> handleMessages: (messages) ->
# Disable scrolling automagically when user manually scrolled # Disable scrolling automagically when user manually scrolled
unless @oldScrollTop is null unless @oldScrollTop is null
if $('.chatMessageContainer').scrollTop() isnt @oldScrollTop if $('.chatMessageContainer').scrollTop() < @oldScrollTop
if $('#chatAutoscroll').data('status') is 1 if $('#chatAutoscroll').data('status') is 1
$('#chatAutoscroll').click() $('#chatAutoscroll').click()
$('#chatAutoscroll').addClass('hot').fadeOut('slow').fadeIn('slow') $('#chatAutoscroll').addClass('hot').fadeOut('slow').fadeIn('slow')
@ -257,7 +258,7 @@ TimWolla.WCF ?= {}
# Autoscroll down # Autoscroll down
if $('#chatAutoscroll').data('status') is 1 if $('#chatAutoscroll').data('status') is 1
$('.chatMessageContainer').scrollTop $('.chatMessageContainer ul').height() $('.chatMessageContainer').scrollTop $('.chatMessageContainer ul').height()
@oldScrollTop = $('.chatMessageContainer').scrollTop() @oldScrollTop = $('.chatMessageContainer').scrollTop()
### ###
# Builds the userlist. # Builds the userlist.
# #