mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 14:05:46 +01:00
fix for category view when its empty
This commit is contained in:
@@ -389,14 +389,20 @@
|
||||
socket.on('api:posts.favourite', function(data) {
|
||||
if (data.status === 'ok' && data.pid) {
|
||||
var favEl = document.querySelector('.post_rep_' + data.pid).nextSibling;
|
||||
if (favEl) favEl.className = 'icon-star';
|
||||
if (favEl) {
|
||||
favEl.className = 'icon-star';
|
||||
$(favEl).parent().addClass('btn-warning');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('api:posts.unfavourite', function(data) {
|
||||
if (data.status === 'ok' && data.pid) {
|
||||
var favEl = document.querySelector('.post_rep_' + data.pid).nextSibling;
|
||||
if (favEl) favEl.className = 'icon-star-empty';
|
||||
if (favEl) {
|
||||
favEl.className = 'icon-star-empty';
|
||||
$(favEl).parent().removeClass('btn-warning');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user