dont use toPid if "topic/reply" is clicked

v1.18.x
barisusakli 9 years ago
parent 24704cadbd
commit 5634c5417c

@ -146,12 +146,15 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
if (getData(button, 'data-uid') === '0') { if (getData(button, 'data-uid') === '0') {
username = ''; username = '';
} }
var toPid = button.is('[component="post/reply"]') ? getData(button, 'data-pid') : null;
if (selectionText.length) { if (selectionText.length) {
$(window).trigger('action:composer.addQuote', { $(window).trigger('action:composer.addQuote', {
tid: tid, tid: tid,
slug: ajaxify.data.slug, slug: ajaxify.data.slug,
index: getData(button, 'data-index'), index: getData(button, 'data-index'),
pid: getData(button, 'data-pid'), pid: toPid,
topicName: topicName, topicName: topicName,
username: username, username: username,
text: selectionText text: selectionText
@ -159,7 +162,7 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
} else { } else {
$(window).trigger('action:composer.post.new', { $(window).trigger('action:composer.post.new', {
tid: tid, tid: tid,
pid: getData(button, 'data-pid'), pid: toPid,
topicName: topicName, topicName: topicName,
text: username ? username + ' ' : '' text: username ? username + ' ' : ''
}); });

Loading…
Cancel
Save