fixed flag post, added highlight to scroll post

v1.18.x
Baris Soner Usakli 11 years ago
parent bbc2df11e1
commit 3ed2d21eb6

@ -290,14 +290,14 @@ var socket,
var el = jQuery(this), var el = jQuery(this),
uid = el.parents('li').attr('data-uid'); uid = el.parents('li').attr('data-uid');
translator.translate('[[global:' + users[uid].status + ']]', function(translated) {
if (uid && users[uid]) { if (uid && users[uid]) {
el.siblings('i') translator.translate('[[global:' + users[uid].status + ']]', function(translated) {
.attr('class', 'fa fa-circle status ' + users[uid].status) el.siblings('i')
.attr('title', translated) .attr('class', 'fa fa-circle status ' + users[uid].status)
.attr('data-original-title', translated); .attr('title', translated)
.attr('data-original-title', translated);
});
} }
});
}); });
}); });
}; };

@ -467,10 +467,10 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
}); });
$('#post-container').on('click', '.flag', function() { $('#post-container').on('click', '.flag', function() {
var btn = $(this);
bootbox.confirm('Are you sure you want to flag this post?', function(confirm) { bootbox.confirm('Are you sure you want to flag this post?', function(confirm) {
if (confirm) { if (confirm) {
var pid = $(this).parents('.post-row').attr('data-pid'); var pid = btn.parents('.post-row').attr('data-pid');
socket.emit('posts.flag', pid, function(err) { socket.emit('posts.flag', pid, function(err) {
if(err) { if(err) {
return app.alertError(err.message); return app.alertError(err.message);
@ -1096,6 +1096,12 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
scrollTop: (scrollTo.offset().top - $('#header-menu').height() - offset) + "px" scrollTop: (scrollTo.offset().top - $('#header-menu').height() - offset) + "px"
}, duration !== undefined ? duration : 400, function() { }, duration !== undefined ? duration : 400, function() {
updateHeader(); updateHeader();
scrollTo.parent().addClass('highlight');
setTimeout(function() {
scrollTo.parent().removeClass('highlight');
}, 5000);
}); });
} }

@ -266,7 +266,6 @@ SocketPosts.flag = function(socket, pid, callback) {
groups.getByGroupName('administrators', {}, next); groups.getByGroupName('administrators', {}, next);
}, },
function(adminGroup, next) { function(adminGroup, next) {
notifications.create({ notifications.create({
text: message, text: message,
path: path, path: path,

Loading…
Cancel
Save