more fixes

This commit is contained in:
Baris Soner Usakli
2014-01-16 19:58:57 -05:00
parent 6da6baa213
commit 426d3e871f
6 changed files with 143 additions and 200 deletions

View File

@@ -55,19 +55,19 @@ define(function() {
$('#mark-allread-btn').on('click', function() {
var btn = $(this);
socket.emit('topics.markAllRead', {}, function(success) {
if (success) {
btn.remove();
$('#topics-container').empty();
$('#category-no-topics').removeClass('hidden');
app.alertSuccess('All topics marked as read!');
$('#numUnreadBadge')
.removeClass('badge-important')
.addClass('badge-inverse')
.html('0');
} else {
app.alertError('There was an error marking topics read!');
socket.emit('topics.markAllRead', function(err) {
if(err) {
return app.alertError('There was an error marking topics read!');
}
btn.remove();
$('#topics-container').empty();
$('#category-no-topics').removeClass('hidden');
app.alertSuccess('All topics marked as read!');
$('#numUnreadBadge')
.removeClass('badge-important')
.addClass('badge-inverse')
.html('0');
});
});