diff --git a/public/css/topic.less b/public/css/topic.less index ed3621d4f2..5cedae5113 100644 --- a/public/css/topic.less +++ b/public/css/topic.less @@ -59,7 +59,7 @@ max-height: 10px; padding-top: 5px; margin-right: 5px; - + } } .post-content { @@ -78,6 +78,10 @@ float: right; margin-right: 5px; + button.show { + display: inline-block!important; + } + button, a { display: inline-block; padding: 0px 15px; @@ -99,7 +103,7 @@ } } - + &.deleted { -moz-opacity: 0.30; @@ -117,7 +121,7 @@ } @media (min-width: 979px) { - .speech-bubble:after + .speech-bubble:after { content: ""; position: absolute; @@ -131,7 +135,7 @@ z-index: 1; } - .speech-bubble:before + .speech-bubble:before { content: ""; position: absolute; @@ -155,7 +159,7 @@ overflow: hidden; margin: 0; padding: 0; - padding-top: 5px; + padding-top: 0px; margin-bottom: -5px; padding-bottom: 5px; } @@ -170,8 +174,8 @@ padding-bottom: 0px; text-align: center; width:80px; - - @media (max-width: 767px) { + + @media (max-width: 767px) { display: none; } } @@ -217,7 +221,9 @@ } .topic-buttons { - margin-top: 8px; + button.show { + display: inline-block!important; + } } } diff --git a/public/src/app.js b/public/src/app.js index 9da3ef929f..6882ea4235 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -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(''); } + 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; }); }); diff --git a/public/templates/topic.tpl b/public/templates/topic.tpl index 0c98be05ce..a8a307d42e 100644 --- a/public/templates/topic.tpl +++ b/public/templates/topic.tpl @@ -30,10 +30,21 @@
{topic_name}
- -