From e7e8457ca53549980c82ac64a80736655e41f01f Mon Sep 17 00:00:00 2001 From: max-m Date: Sun, 4 Dec 2011 11:52:56 +0100 Subject: [PATCH] Made userlist toggleable. --- file/js/TimWolla.WCF.Chat.js | 18 +++++++++++++++++- template/chat.tpl | 28 +++++++++++++++++++--------- 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/file/js/TimWolla.WCF.Chat.js b/file/js/TimWolla.WCF.Chat.js index 97565cf..546cdad 100644 --- a/file/js/TimWolla.WCF.Chat.js +++ b/file/js/TimWolla.WCF.Chat.js @@ -31,6 +31,11 @@ if (typeof TimWolla.WCF == 'undefined') TimWolla.WCF = {}; this.changeRoom($(event.target)); } }, this)); + + $('.chatUser .chatUserLink').click($.proxy(function (event) { + event.preventDefault(); + this.toggleUserMenu($(event.target)); + }, this)); }, changeRoom: function(target) { window.history.replaceState({}, '', target.attr('href')); @@ -54,7 +59,7 @@ if (typeof TimWolla.WCF == 'undefined') TimWolla.WCF = {}; if (data.topic == '') { if(data.topic == '' && $('#topic').text().trim() == '') return; $('#topic').wcfBlindOut('vertical', function() { - $('#topic').text(''); + $(this).text(''); }); } else { if($('#topic').text().trim() != '') { @@ -87,6 +92,17 @@ if (typeof TimWolla.WCF == 'undefined') TimWolla.WCF = {}; $('#loading-' + target.attr('id')).css({'marginTop' : function(index) {return (target.parent().height() / 2) - ($(this).height() / 2)}}); }, this) }); + }, + toggleUserMenu: function(target) { + liUserID = '#' + target.parent().attr('id'); + if($(liUserID).hasClass('activeMenuItem')) { + $(liUserID + ' .chatUserMenu').wcfBlindOut('vertical', function() { + $(liUserID).removeClass('activeMenuItem'); + }); + } else { + $(liUserID).addClass('activeMenuItem'); + $(liUserID + ' .chatUserMenu').wcfBlindIn(); + } } }; })(jQuery, document); \ No newline at end of file diff --git a/template/chat.tpl b/template/chat.tpl index 5385a38..34e5ade 100644 --- a/template/chat.tpl +++ b/template/chat.tpl @@ -140,6 +140,20 @@ margin-left: 20px; } + .chatUserMenu { + display: none; + } + + #chatUserList .sidebarMenuGroup > ul li a { + margin-left: 20px; + } + + /* + .chatUser.activeMenuItem { + margin-bottom: 5px; + } + */ + .ajaxLoad { margin-right: 2px; float: right; @@ -220,9 +234,10 @@

User