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

Don't show topic of a room again if it has been hidden during the current session

This commit is contained in:
Maximilian Mader 2014-03-13 20:56:46 +01:00
parent 76e2893be6
commit 8e0a07ab30

View File

@ -42,6 +42,7 @@ exposed by a function if necessary.
active: {} active: {}
available: {} available: {}
hiddenTopics = {}
fileUploaded = no fileUploaded = no
errorVisible = false errorVisible = false
inputErrorHidingTimer = null inputErrorHidingTimer = null
@ -347,8 +348,11 @@ Toggle checkboxes.
Hide topic container. Hide topic container.
$('#timsChatTopicCloser').on 'click', -> $('#timsChatTopicCloser').on 'click', ->
$('#timsChatTopic').addClass 'invisible' unless hiddenTopics[roomList.active.roomID]?
do $(window).resize hiddenTopics[roomList.active.roomID] = true
$('#timsChatTopic').addClass 'invisible'
do $(window).resize
Close private channels Close private channels
@ -885,13 +889,10 @@ Joins a room.
roomID: roomID roomID: roomID
success: (data) -> success: (data) ->
loading = false loading = false
roomList.active = data.returnValues roomList.active = data.returnValues
$('#timsChatTopic').removeClass 'invisible'
$('#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'