some changes to topic view + BS3 upgrade

This commit is contained in:
psychobunny
2013-08-24 04:34:13 +08:00
parent 0f8aad52b2
commit 13e13cd5a8
3 changed files with 53 additions and 20 deletions

View File

@@ -78,7 +78,7 @@ var socket,
});
socket.on('api:user.get_online_users', function(users) {
jQuery('.username-field').each(function() {
jQuery('a.username-field').each(function() {
if (this.processed === true)
return;
@@ -93,6 +93,22 @@ var socket,
el.prepend('<i class="icon-circle-blank"></i>');
}
el.processed = true;
});
jQuery('button .username-field').each(function() {
//DRY FAIL
if (this.processed === true)
return;
var el = jQuery(this),
uid = el.parents('li').attr('data-uid');
if (uid && jQuery.inArray(uid, users) !== -1) {
el.parent().addClass('btn-success');
} else {
el.parent().addClass('btn-danger');
}
el.processed = true;
});
});