1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-10-31 14:10:08 +00:00

Fix topic hiding mechanism

This commit is contained in:
Maximilian Mader 2014-03-17 22:04:46 +01:00
parent dcdaa54ab7
commit ec2a5b07ff

View File

@ -43,6 +43,8 @@ exposed by a function if necessary.
available: {} available: {}
hiddenTopics = {} hiddenTopics = {}
hidePrivateChannelTopic = no
isJoining = no isJoining = no
fileUploaded = no fileUploaded = no
errorVisible = false errorVisible = false
@ -349,8 +351,10 @@ Toggle checkboxes.
Hide topic container. Hide topic container.
$('#timsChatTopicCloser').on 'click', -> $('#timsChatTopicCloser').on 'click', ->
unless hiddenTopics[roomList.active.roomID]? if openChannel is 0
hiddenTopics[roomList.active.roomID] = true hiddenTopics[roomList.active.roomID] = true
else
hidePrivateChannelTopic = yes
$('#timsChatTopic').addClass 'invisible' $('#timsChatTopic').addClass 'invisible'
do $(window).resize do $(window).resize
@ -899,6 +903,7 @@ Joins a room.
loading = false loading = false
roomList.active = data.returnValues roomList.active = data.returnValues
if openChannel is 0
$('#timsChatTopic > .topic').text roomList.active.topic $('#timsChatTopic > .topic').text roomList.active.topic
if roomList.active.topic.trim() is '' or hiddenTopics[roomList.active.roomID]? if roomList.active.topic.trim() is '' or hiddenTopics[roomList.active.roomID]?
$('#timsChatTopic').addClass 'invisible' $('#timsChatTopic').addClass 'invisible'
@ -944,7 +949,11 @@ Open private channel
$('.timsChatMessageContainer').height $('.timsChatMessageContainer').height() $('.timsChatMessageContainer').height $('.timsChatMessageContainer').height()
if userID isnt 0 if userID isnt 0
if hidePrivateChannelTopic
$('#timsChatTopic').addClass 'invisible'
else
$('#timsChatTopic').removeClass 'invisible' $('#timsChatTopic').removeClass 'invisible'
$('#timsChatTopic > .topic').html WCF.Language.get 'chat.global.privateChannelTopic', {username: userList.allTime[userID].username} $('#timsChatTopic > .topic').html WCF.Language.get 'chat.global.privateChannelTopic', {username: userList.allTime[userID].username}
$('#timsChatMessageTabMenu').removeClass 'singleTab' $('#timsChatMessageTabMenu').removeClass 'singleTab'
@ -969,7 +978,7 @@ Open private channel
WCF.System.FlexibleMenu.rebuild $('#timsChatMessageTabMenu > .tabMenu').attr 'id' WCF.System.FlexibleMenu.rebuild $('#timsChatMessageTabMenu > .tabMenu').attr 'id'
else else
$('#timsChatTopic > .topic').text roomList.active.topic $('#timsChatTopic > .topic').text roomList.active.topic
if roomList.active.topic.trim() is '' if roomList.active.topic.trim() is '' or hiddenTopics[roomList.active.roomID]?
$('#timsChatTopic').addClass 'invisible' $('#timsChatTopic').addClass 'invisible'
else else
$('#timsChatTopic').removeClass 'invisible' $('#timsChatTopic').removeClass 'invisible'