mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 14:35:47 +01:00
fixed error in favouriting posts
This commit is contained in:
@@ -445,14 +445,24 @@
|
|||||||
uid = ids[1];
|
uid = ids[1];
|
||||||
|
|
||||||
if (thread_state.locked !== '1') {
|
if (thread_state.locked !== '1') {
|
||||||
if (this.children[2].className == 'icon-star-empty') {
|
var element = $(this).find('i');
|
||||||
|
if(element.attr('class') == 'icon-star-empty') {
|
||||||
|
element.attr('class', 'icon-star');
|
||||||
|
socket.emit('api:posts.favourite', {pid: pid, room_id: app.current_room});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
element.attr('class', 'icon-star-empty');
|
||||||
|
socket.emit('api:posts.unfavourite', {pid: pid, room_id: app.current_room});
|
||||||
|
}
|
||||||
|
|
||||||
|
/*if (this.children[2].className == 'icon-star-empty') {
|
||||||
this.children[2].className = 'icon-star';
|
this.children[2].className = 'icon-star';
|
||||||
socket.emit('api:posts.favourite', {pid: pid, room_id: app.current_room});
|
socket.emit('api:posts.favourite', {pid: pid, room_id: app.current_room});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.children[2].className = 'icon-star-empty';
|
this.children[2].className = 'icon-star-empty';
|
||||||
socket.emit('api:posts.unfavourite', {pid: pid, room_id: app.current_room});
|
socket.emit('api:posts.unfavourite', {pid: pid, room_id: app.current_room});
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user