store postcontainer

v1.18.x
barisusakli 11 years ago
parent cabc3e5e3d
commit c070808209

@ -21,48 +21,44 @@ define(['composer'], function(composer) {
onReplyClicked($(this), tid, topicName); onReplyClicked($(this), tid, topicName);
} }
}); });
var postContainer = $('#post-container');
$('#post-container').on('click', '.quote', function() { postContainer.on('click', '.quote', function() {
if (threadState.locked !== '1') { if (threadState.locked !== '1') {
onQuoteClicked($(this), tid, topicName); onQuoteClicked($(this), tid, topicName);
} }
}); });
$('#post-container').on('click', '.favourite', function() { postContainer.on('click', '.favourite', function() {
favouritePost($(this), getPid($(this))); favouritePost($(this), getPid($(this)));
}); });
$('#post-container').on('click', '.upvote', function() { postContainer.on('click', '.upvote', function() {
toggleVote($(this), '.upvoted', 'posts.upvote'); toggleVote($(this), '.upvoted', 'posts.upvote');
}); });
$('#post-container').on('click', '.downvote', function() { postContainer.on('click', '.downvote', function() {
toggleVote($(this), '.downvoted', 'posts.downvote'); toggleVote($(this), '.downvoted', 'posts.downvote');
}); });
$('#post-container').on('click', '.flag', function() { postContainer.on('click', '.flag', function() {
flagPost(getPid($(this))); flagPost(getPid($(this)));
}); });
$('#post-container').on('click', '.edit', function(e) { postContainer.on('click', '.edit', function(e) {
composer.editPost(getPid($(this))); composer.editPost(getPid($(this)));
}); });
$('#post-container').on('click', '.delete', function(e) { postContainer.on('click', '.delete', function(e) {
deletePost($(this), tid); deletePost($(this), tid);
}); });
$('#post-container').on('click', '.move', function(e) { postContainer.on('click', '.move', function(e) {
openMovePostModal($(this)); openMovePostModal($(this));
}); });
postContainer.on('click', '.chat', function(e) {
$('#post-container').on('click', '.chat', function(e) { openChat($(this));
var post = $(this).parents('li.post-row');
app.openChat(post.attr('data-username'), post.attr('data-uid'));
$(this).parents('.btn-group').find('.dropdown-toggle').click();
return false;
}); });
} }
@ -223,6 +219,14 @@ define(['composer'], function(composer) {
}); });
} }
function openChat(button) {
var post = button.parents('li.post-row');
app.openChat(post.attr('data-username'), post.attr('data-uid'));
button.parents('.btn-group').find('.dropdown-toggle').click();
return false;
}
function addShareHandlers() { function addShareHandlers() {
function openShare(url, pid, width, height) { function openShare(url, pid, width, height) {

Loading…
Cancel
Save