mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
Improve fullscreen
This commit is contained in:
parent
2dd8c47778
commit
c32bd4bbef
@ -45,6 +45,8 @@ exposed by a function if necessary.
|
|||||||
lastMessage = null
|
lastMessage = null
|
||||||
openChannel = 0
|
openChannel = 0
|
||||||
|
|
||||||
|
messageContainerSize = 0
|
||||||
|
|
||||||
remainingFailures = 3
|
remainingFailures = 3
|
||||||
|
|
||||||
events =
|
events =
|
||||||
@ -77,6 +79,8 @@ Initialize **Tims Chat**. Bind needed DOM events and initialize data structures.
|
|||||||
return false if initialized
|
return false if initialized
|
||||||
initialized = true
|
initialized = true
|
||||||
|
|
||||||
|
messageContainerSize = $('.timsChatMessageContainer').height()
|
||||||
|
|
||||||
v.config = config
|
v.config = config
|
||||||
v.titleTemplate = titleTemplate
|
v.titleTemplate = titleTemplate
|
||||||
v.messageTemplate = messageTemplate
|
v.messageTemplate = messageTemplate
|
||||||
@ -111,7 +115,23 @@ 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 ->
|
||||||
|
# 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.
|
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')} "
|
||||||
@ -276,7 +296,9 @@ Toggle fullscreen mode.
|
|||||||
|
|
||||||
if $(@).data 'status'
|
if $(@).data 'status'
|
||||||
$('html').addClass 'fullscreen'
|
$('html').addClass 'fullscreen'
|
||||||
|
do $(window).resize
|
||||||
else
|
else
|
||||||
|
$('.timsChatMessageContainer').height messageContainerSize
|
||||||
$('html').removeClass 'fullscreen'
|
$('html').removeClass 'fullscreen'
|
||||||
|
|
||||||
Toggle checkboxes.
|
Toggle checkboxes.
|
||||||
@ -289,7 +311,9 @@ Toggle checkboxes.
|
|||||||
|
|
||||||
Hide topic container.
|
Hide topic container.
|
||||||
|
|
||||||
$('#timsChatTopicCloser').on 'click', -> $('#timsChatTopic').addClass 'invisible'
|
$('#timsChatTopicCloser').on 'click', ->
|
||||||
|
$('#timsChatTopic').addClass 'invisible'
|
||||||
|
do $(window).resize
|
||||||
|
|
||||||
Close private channels
|
Close private channels
|
||||||
|
|
||||||
|
@ -292,10 +292,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&:not(:last-child) {
|
> .timsChatInnerMessageContainer {
|
||||||
> .timsChatInnerMessageContainer {
|
margin-bottom: @wcfGapSmall;
|
||||||
margin-bottom: @wcfGapSmall;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -471,6 +469,11 @@
|
|||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
html.fullscreen {
|
html.fullscreen {
|
||||||
|
html, body {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
&,
|
&,
|
||||||
body,
|
body,
|
||||||
#tplChat #main,
|
#tplChat #main,
|
||||||
@ -485,7 +488,17 @@ html.fullscreen {
|
|||||||
|
|
||||||
#top,
|
#top,
|
||||||
#pageHeader,
|
#pageHeader,
|
||||||
#pageFooter {
|
#pageFooter,
|
||||||
|
#mainMenu,
|
||||||
|
#topMenu {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sidebar, #main, #content {
|
||||||
|
padding-top: 0;
|
||||||
|
padding-bottom: 0;
|
||||||
|
border-top: none;
|
||||||
|
border-bottom: none;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user