diff --git a/file/js/be.bastelstu.Chat.coffee b/file/js/be.bastelstu.Chat.coffee index 7976778..4a94805 100644 --- a/file/js/be.bastelstu.Chat.coffee +++ b/file/js/be.bastelstu.Chat.coffee @@ -178,6 +178,13 @@ window.console ?= # Refreshes the roomlist $('#timsChatRoomList button').click $.proxy @refreshRoomList, @ + # Clears the stream + $('#timsChatClear').click (event) -> + event.preventDefault() + $('.timsChatMessage').remove() + @oldScrollTop = null + $('#timsChatMessageContainer').scrollTop $('#timsChatMessageContainer ul').height() + # Toggle Buttons $('.timsChatToggle').click (event) -> element = $ @ @@ -193,19 +200,6 @@ window.console ?= $('#timsChatInput').focus() - # Clears the stream - $('#timsChatClear').click (event) -> - event.preventDefault() - $('.timsChatMessage').remove() - @oldScrollTop = null - $('#timsChatMessageContainer').scrollTop $('#timsChatMessageContainer ul').height() - - $('#timsChatSmilies').click (event) -> - if $(@).data 'status' - $('#smilies').removeClass 'disabled' - else - $('#smilies').addClass 'disabled' - # Enable fullscreen-mode $('#timsChatFullscreen').click (event) -> if $(@).data 'status' @@ -225,7 +219,7 @@ window.console ?= $('#timsChatNotify').click (event) -> if $(@).data('status') and window.webkitNotifications.checkPermission() isnt 0 window.webkitNotifications.requestPermission() - + ### # Changes the chat-room. # @@ -248,14 +242,11 @@ window.console ?= target.parent().addClass 'activeMenuItem' # Set new topic + $('#timsChatTopic').text data.topic if data.topic is '' - return if $('#timsChatTopic').text().trim() is '' - - $('#timsChatTopic').wcfBlindOut 'vertical', () -> - $(@).text '' + $('#timsChatTopic').addClass 'empty' else - $('#timsChatTopic').text data.topic - $('#timsChatTopic').wcfBlindIn() if $('#timsChatTopic').text().trim() isnt '' and $('#timsChatTopic').is ':hidden' + $('#timsChatTopic').removeClass 'empty' $('.timsChatMessage').addClass 'unloaded', 800 @handleMessages data.messages @@ -383,7 +374,7 @@ window.console ?= element.addClass 'away' element.attr 'title', user.awayStatus else - element.removeClass 'away' + element.removeClass 'timsChatAway' element.removeAttr 'title' element.data 'tooltip', '' if user.suspended diff --git a/file/style/be.bastelstu.wcf.chat.less b/file/style/be.bastelstu.wcf.chat.less index 4d77ee6..40a257c 100644 --- a/file/style/be.bastelstu.wcf.chat.less +++ b/file/style/be.bastelstu.wcf.chat.less @@ -13,6 +13,16 @@ #timsChatTopic { padding: 5px; + .transition(height, .2s); + .transition(padding-top, .2s); + .transition(padding-bottom, .2s); + + &.empty { + height: 0px; + overflow: hidden; + border: 0px; + padding: 0px; + } } } } diff --git a/template/chat.tpl b/template/chat.tpl index 9fec948..887a4e4 100644 --- a/template/chat.tpl +++ b/template/chat.tpl @@ -89,7 +89,7 @@ {include file='header' sandbox=false sidebarOrientation='right'}
-
topic|language === ''} style="display: none;"{/if}>{$room->topic|language}
+
{$room->topic|language}