closes #4141, closes #4149

This commit is contained in:
barisusakli
2016-02-18 18:32:08 +02:00
parent 759b183967
commit 2fc385f723
7 changed files with 62 additions and 53 deletions

View File

@@ -4,17 +4,14 @@
define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator'], function(share, navigator, components, translator) {
var PostTools = {},
topicName;
var PostTools = {};
PostTools.init = function(tid) {
topicName = ajaxify.data.title;
renderMenu();
addPostHandlers(tid);
share.addShareHandlers(topicName);
share.addShareHandlers(ajaxify.data.title);
addVoteHandler();
@@ -106,15 +103,15 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
var postContainer = components.get('topic');
postContainer.on('click', '[component="post/quote"]', function() {
onQuoteClicked($(this), tid, topicName);
onQuoteClicked($(this), tid);
});
postContainer.on('click', '[component="post/reply"]', function() {
onReplyClicked($(this), tid, topicName);
onReplyClicked($(this), tid);
});
$('.topic').on('click', '[component="topic/reply"]', function() {
onReplyClicked($(this), tid, topicName);
onReplyClicked($(this), tid);
});
$('.topic').on('click', '[component="topic/reply-as-topic"]', function() {
@@ -174,7 +171,7 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
});
}
function onReplyClicked(button, tid, topicName) {
function onReplyClicked(button, tid) {
showStaleWarning(function(proceed) {
if (!proceed) {
var selectionText = '',
@@ -197,7 +194,7 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
slug: ajaxify.data.slug,
index: getData(button, 'data-index'),
pid: toPid,
topicName: topicName,
topicName: ajaxify.data.title,
username: username,
text: selectionText
});
@@ -205,7 +202,7 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
$(window).trigger('action:composer.post.new', {
tid: tid,
pid: toPid,
topicName: topicName,
topicName: ajaxify.data.title,
text: username ? username + ' ' : ''
});
}
@@ -213,7 +210,7 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
});
}
function onQuoteClicked(button, tid, topicName) {
function onQuoteClicked(button, tid) {
showStaleWarning(function(proceed) {
if (!proceed) {
var username = getUserName(button),
@@ -230,7 +227,7 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
index: getData(button, 'data-index'),
pid: pid,
username: username,
topicName: topicName,
topicName: ajaxify.data.title,
text: post
});
});
@@ -368,7 +365,7 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
});
topicId.on('keyup change', function() {
moveBtn.attr('disabled', !topicId.val())
moveBtn.attr('disabled', !topicId.val());
});
moveBtn.on('click', function() {