From 8e0a07ab30a619f27a145ce5da7abda96e67d427 Mon Sep 17 00:00:00 2001 From: Maximilian Mader Date: Thu, 13 Mar 2014 20:56:46 +0100 Subject: [PATCH] Don't show topic of a room again if it has been hidden during the current session --- file/js/be.bastelstu.Chat.litcoffee | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/file/js/be.bastelstu.Chat.litcoffee b/file/js/be.bastelstu.Chat.litcoffee index 1a108b2..98eb84b 100644 --- a/file/js/be.bastelstu.Chat.litcoffee +++ b/file/js/be.bastelstu.Chat.litcoffee @@ -42,6 +42,7 @@ exposed by a function if necessary. active: {} available: {} + hiddenTopics = {} fileUploaded = no errorVisible = false inputErrorHidingTimer = null @@ -347,9 +348,12 @@ Toggle checkboxes. Hide topic container. $('#timsChatTopicCloser').on 'click', -> - $('#timsChatTopic').addClass 'invisible' - do $(window).resize - + unless hiddenTopics[roomList.active.roomID]? + hiddenTopics[roomList.active.roomID] = true + + $('#timsChatTopic').addClass 'invisible' + do $(window).resize + Close private channels $('#timsChatMessageTabMenu').on 'click', '.jsChannelCloser', -> closePrivateChannel $(@).parent().data 'userID' @@ -885,13 +889,10 @@ Joins a room. roomID: roomID success: (data) -> loading = false - roomList.active = data.returnValues - $('#timsChatTopic').removeClass 'invisible' - $('#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' else $('#timsChatTopic').removeClass 'invisible'