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

Improve fullscreen

This commit is contained in:
Maximilian Mader 2014-02-23 01:17:15 +01:00
parent 2dd8c47778
commit c32bd4bbef
2 changed files with 44 additions and 7 deletions

View File

@ -45,6 +45,8 @@ exposed by a function if necessary.
lastMessage = null
openChannel = 0
messageContainerSize = 0
remainingFailures = 3
events =
@ -77,6 +79,8 @@ Initialize **Tims Chat**. Bind needed DOM events and initialize data structures.
return false if initialized
initialized = true
messageContainerSize = $('.timsChatMessageContainer').height()
v.config = config
v.titleTemplate = titleTemplate
v.messageTemplate = messageTemplate
@ -111,7 +115,23 @@ Make the user leave the chat when **Tims Chat** is about to be unloaded.
async: false
suppressErrors: true
undefined
$(window).resize ->
# TODO
return if WCF.System.Mobile.UX._enabled
return unless $('html').hasClass 'fullscreen'
verticalContentPadding = $('#content').innerHeight() - $('#content').height()
verticalSizeOfContentElements = do ->
height = 0
$('#content > *:visible').each (k, v) -> height += $(v).outerHeight()
height
freeSpace = $('body').height() - verticalContentPadding - verticalSizeOfContentElements
$('.timsChatMessageContainer').height $('.timsChatMessageContainer').height() + freeSpace
Insert the appropriate smiley code into the input when a smiley is clicked.
$('#smilies').on 'click', 'img', -> insertText " #{$(@).attr('alt')} "
@ -276,7 +296,9 @@ Toggle fullscreen mode.
if $(@).data 'status'
$('html').addClass 'fullscreen'
do $(window).resize
else
$('.timsChatMessageContainer').height messageContainerSize
$('html').removeClass 'fullscreen'
Toggle checkboxes.
@ -289,7 +311,9 @@ Toggle checkboxes.
Hide topic container.
$('#timsChatTopicCloser').on 'click', -> $('#timsChatTopic').addClass 'invisible'
$('#timsChatTopicCloser').on 'click', ->
$('#timsChatTopic').addClass 'invisible'
do $(window).resize
Close private channels

View File

@ -292,10 +292,8 @@
}
}
&:not(:last-child) {
> .timsChatInnerMessageContainer {
margin-bottom: @wcfGapSmall;
}
> .timsChatInnerMessageContainer {
margin-bottom: @wcfGapSmall;
}
}
}
@ -471,6 +469,11 @@
// TODO
html.fullscreen {
html, body {
padding: 0;
margin: 0;
}
&,
body,
#tplChat #main,
@ -485,7 +488,17 @@ html.fullscreen {
#top,
#pageHeader,
#pageFooter {
#pageFooter,
#mainMenu,
#topMenu {
display: none;
}
.sidebar, #main, #content {
padding-top: 0;
padding-bottom: 0;
border-top: none;
border-bottom: none;
border-radius: 0;
}
}