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

Fix scroll position when toggling fullscreen

This commit is contained in:
Maximilian Mader 2014-02-27 22:33:51 +01:00
parent ae27b7e059
commit 511ebba4f6

View File

@ -119,32 +119,32 @@ Make the user leave the chat when **Tims Chat** is about to be unloaded.
async: false async: false
suppressErrors: true suppressErrors: true
undefined undefined
$(window).resize -> $(window).resize ->
# TODO # TODO
return if WCF.System.Mobile.UX._enabled return if WCF.System.Mobile.UX._enabled
return unless $('html').hasClass 'fullscreen' if $('html').hasClass 'fullscreen'
do ->
do -> verticalContentPadding = $('#content').innerHeight() - $('#content').height()
verticalContentPadding = $('#content').innerHeight() - $('#content').height() verticalSizeOfContentElements = do ->
verticalSizeOfContentElements = do -> height = 0
height = 0 $('#content > *:visible').each (k, v) -> height += $(v).outerHeight()
$('#content > *:visible').each (k, v) -> height += $(v).outerHeight() height
height
freeSpace = $('body').height() - verticalContentPadding - verticalSizeOfContentElements
freeSpace = $('body').height() - verticalContentPadding - verticalSizeOfContentElements
$('.timsChatMessageContainer').height $('.timsChatMessageContainer').height() + freeSpace
$('.timsChatMessageContainer').height $('.timsChatMessageContainer').height() + freeSpace do ->
do -> verticalUserListContainerPadding = $('#timsChatUserListContainer').innerHeight() - $('#timsChatUserListContainer').height()
verticalUserListContainerPadding = $('#timsChatUserListContainer').innerHeight() - $('#timsChatUserListContainer').height() sidebarHeight = $('.sidebar > div').height()
sidebarHeight = $('.sidebar > div').height()
freeSpace = $('body').height() - verticalUserListContainerPadding - sidebarHeight
freeSpace = $('body').height() - verticalUserListContainerPadding - sidebarHeight $('#timsChatUserList').height $('#timsChatUserList').height() + freeSpace
$('#timsChatUserList').height $('#timsChatUserList').height() + freeSpace
if $('#timsChatAutoscroll').data 'status'
$('.timsChatMessageContainer.active').scrollTop $('.timsChatMessageContainer.active').prop 'scrollHeight'
Insert the appropriate smiley code into the input when a smiley is clicked. Insert the appropriate smiley code into the input when a smiley is clicked.
$('#smilies').on 'click', 'img', -> insertText " #{$(@).attr('alt')} " $('#smilies').on 'click', 'img', -> insertText " #{$(@).attr('alt')} "
@ -334,6 +334,7 @@ Toggle fullscreen mode.
$('.timsChatMessageContainer').height messageContainerSize $('.timsChatMessageContainer').height messageContainerSize
$('#timsChatUserList').height userListSize $('#timsChatUserList').height userListSize
$('html').removeClass 'fullscreen' $('html').removeClass 'fullscreen'
do $(window).resize
Toggle checkboxes. Toggle checkboxes.