mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-03-12 13:31:14 +00:00
add click to post citation to open related conversation
This commit is contained in:
parent
21e9db5ea3
commit
7a6669d926
@ -293,7 +293,7 @@ function openConversationClick(e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
var postData = $(this).parents('.module.post.original.open .module.post.original .post-data');
|
||||
var postData = $(this).closest(e.data.feeder);
|
||||
|
||||
window.location.hash = '#conversation?post=' + postData.attr('data-screen-name') +
|
||||
':post' + postData.attr('data-id');
|
||||
@ -1427,7 +1427,8 @@ function initInterfaceCommon() {
|
||||
;
|
||||
$('.post-submit').on('click', postSubmit);
|
||||
$('.modal-propagate').on('click', retweetSubmit);
|
||||
$('.expanded-content .show-more').on('click', openConversationClick);
|
||||
$('.expanded-content .show-more').on('click',
|
||||
{feeder: '.module.post.original.open .module.post.original .post-data'}, openConversationClick);
|
||||
|
||||
if ($.Options.unicodeConversion.val === 'disable')
|
||||
$('.undo-unicode').on('click', undoLastUnicode).css('display', 'none');
|
||||
|
@ -12,6 +12,8 @@ var _htmlFormatMsgLinkTemplateHashtag;
|
||||
$(document).ready(function() {
|
||||
// we're setting it here for perfomance improvement purpose // to not search and prepare it for for every post every time
|
||||
_templatePostRtReference = $('#post-rt-reference-template').children().clone(true);
|
||||
_templatePostRtReference.find('.post-text')
|
||||
.on('click', {feeder: '.post-rt-reference'}, openConversationClick);
|
||||
_templatePostRtBy = $('#post-retransmited-by-template').children().clone(true);
|
||||
_htmlFormatMsgLinkTemplateExternal = $('#external-page-link-template')
|
||||
if (_htmlFormatMsgLinkTemplateExternal.length) {
|
||||
@ -165,9 +167,12 @@ function postToElem(post, kind, promoted) {
|
||||
var postContext = elem.find('.post-context');
|
||||
if (userpost.msg) {
|
||||
postContext.append(_templatePostRtReference.clone(true))
|
||||
.find('.post-text').html(htmlFormatMsg(rt.msg).html);
|
||||
.find('.post-rt-reference')
|
||||
.attr('data-screen-name', rt.n)
|
||||
.attr('data-id', rt.k)
|
||||
.find('.post-text').html(htmlFormatMsg(rt.msg).html)
|
||||
;
|
||||
setPostCommon(postContext, rt.n, rt.time)
|
||||
setPostCommon(postContext, rt.n, rt.time);
|
||||
} else {
|
||||
postContext.append(_templatePostRtBy.clone(true))
|
||||
.find('.post-retransmited-by')
|
||||
|
Loading…
x
Reference in New Issue
Block a user