mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-10-31 14:10:08 +00:00
Made userlist toggleable.
This commit is contained in:
parent
f47b796051
commit
e7e8457ca5
@ -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);
|
@ -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 @@
|
||||
<h1 data-menu-item="timwolla.wcf.chat.userlist" class="menuHeader activeMenuItem">User</h1>
|
||||
<div class="sidebarMenuGroup">
|
||||
<ul>
|
||||
<li class="activeMenuItem">
|
||||
<a href="javascript:void(0)">User 1</a>
|
||||
<ul class="selectedUser">
|
||||
{section name=user start=0 loop=10}
|
||||
<li id="user-{$user + 1}" class="chatUser">
|
||||
<a class="chatUserLink" href="javascript:void(0)">User {$user + 1}</a>
|
||||
<ul class="chatUserMenu">
|
||||
<li>
|
||||
<a href="javascript:void(0)">Query</a>
|
||||
<a href="javascript:void(0)">Kick</a>
|
||||
@ -231,12 +246,7 @@
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:void(0)">User 2</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:void(0)">User 3</a>
|
||||
</li>
|
||||
{/section}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user