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:
parent
dcdaa54ab7
commit
ec2a5b07ff
@ -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,12 +351,14 @@ 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
|
||||||
|
|
||||||
Close private channels
|
Close private channels
|
||||||
|
|
||||||
$('#timsChatMessageTabMenu').on 'click', '.jsChannelCloser', -> closePrivateChannel $(@).parent().data 'userID'
|
$('#timsChatMessageTabMenu').on 'click', '.jsChannelCloser', -> closePrivateChannel $(@).parent().data 'userID'
|
||||||
@ -899,11 +903,12 @@ Joins a room.
|
|||||||
loading = false
|
loading = false
|
||||||
roomList.active = data.returnValues
|
roomList.active = data.returnValues
|
||||||
|
|
||||||
$('#timsChatTopic > .topic').text roomList.active.topic
|
if openChannel is 0
|
||||||
if roomList.active.topic.trim() is '' or hiddenTopics[roomList.active.roomID]?
|
$('#timsChatTopic > .topic').text roomList.active.topic
|
||||||
$('#timsChatTopic').addClass 'invisible'
|
if roomList.active.topic.trim() is '' or hiddenTopics[roomList.active.roomID]?
|
||||||
else
|
$('#timsChatTopic').addClass 'invisible'
|
||||||
$('#timsChatTopic').removeClass 'invisible'
|
else
|
||||||
|
$('#timsChatTopic').removeClass 'invisible'
|
||||||
|
|
||||||
$('.timsChatMessage').addClass 'unloaded'
|
$('.timsChatMessage').addClass 'unloaded'
|
||||||
|
|
||||||
@ -944,7 +949,11 @@ Open private channel
|
|||||||
$('.timsChatMessageContainer').height $('.timsChatMessageContainer').height()
|
$('.timsChatMessageContainer').height $('.timsChatMessageContainer').height()
|
||||||
|
|
||||||
if userID isnt 0
|
if userID isnt 0
|
||||||
$('#timsChatTopic').removeClass 'invisible'
|
if hidePrivateChannelTopic
|
||||||
|
$('#timsChatTopic').addClass 'invisible'
|
||||||
|
else
|
||||||
|
$('#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'
|
||||||
|
Loading…
Reference in New Issue
Block a user