mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 14:05:46 +01:00
This commit is contained in:
@@ -431,21 +431,27 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
|
||||
|
||||
$('#post-container').on('click', '.favourite', function() {
|
||||
var pid = $(this).parents('.post-row').attr('data-pid');
|
||||
var uid = $(this).parents('.post-row').attr('data-uid');
|
||||
|
||||
if ($(this).attr('data-favourited') == 'false') {
|
||||
socket.emit('posts.favourite', {
|
||||
pid: pid,
|
||||
room_id: app.currentRoom
|
||||
});
|
||||
} else {
|
||||
socket.emit('posts.unfavourite', {
|
||||
pid: pid,
|
||||
room_id: app.currentRoom
|
||||
});
|
||||
}
|
||||
var method = $(this).attr('data-favourited') == 'false' ? 'posts.favourite' : 'posts.unfavourite';
|
||||
|
||||
socket.emit(method, {
|
||||
pid: pid,
|
||||
room_id: app.currentRoom
|
||||
});
|
||||
});
|
||||
|
||||
$('#post-container').on('click', '.flag', function() {
|
||||
var pid = $(this).parents('.post-row').attr('data-pid');
|
||||
|
||||
socket.emit('posts.flag', pid, function(err) {
|
||||
if(err) {
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
app.alertSuccess('This post has been flagged for moderation.');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$('#post-container').on('shown.bs.dropdown', '.share-dropdown', function() {
|
||||
var pid = $(this).parents('.post-row').attr('data-pid');
|
||||
$('#post_' + pid + '_link').val(window.location.href + "#" + pid);
|
||||
|
||||
Reference in New Issue
Block a user