removed strict li selector

v1.18.x
barisusakli 10 years ago
parent b00ee4828f
commit e7fa000fe0

@ -240,7 +240,7 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
function getUserName(button) { function getUserName(button) {
var username = '', var username = '',
post = button.parents('li[data-pid]'); post = button.parents('[data-pid]');
if (post.length) { if (post.length) {
username = post.attr('data-username').replace(/\s/g, '-'); username = post.attr('data-username').replace(/\s/g, '-');
@ -275,7 +275,7 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
pid: pid, pid: pid,
tid: tid tid: tid
}, function(err) { }, function(err) {
if(err) { if (err) {
app.alertError(err.message); app.alertError(err.message);
} }
}); });
@ -319,7 +319,7 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
socket.emit('topics.movePost', {pid: pid, tid: tid}, function(err) { socket.emit('topics.movePost', {pid: pid, tid: tid}, function(err) {
$('#move-post-modal').addClass('hide'); $('#move-post-modal').addClass('hide');
if(err) { if (err) {
$('#topicId').val(''); $('#topicId').val('');
return app.alertError(err.message); return app.alertError(err.message);
} }
@ -337,15 +337,16 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
function flagPost(pid) { function flagPost(pid) {
translator.translate('[[topic:flag_confirm]]', function(message) { translator.translate('[[topic:flag_confirm]]', function(message) {
bootbox.confirm(message, function(confirm) { bootbox.confirm(message, function(confirm) {
if (confirm) { if (!confirm) {
return;
}
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);
} }
app.alertSuccess('[[topic:flag_success]]'); app.alertSuccess('[[topic:flag_success]]');
}); });
}
}); });
}); });
} }

Loading…
Cancel
Save