From 80be52b2d9be925b86bfb676cb55b6e3b51670df Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Sun, 16 Aug 2015 00:25:17 +0500 Subject: [PATCH] add `click to post citation to open post in tmobile` --- js/tmobile.js | 9 +++++++++ js/twister_formatpost.js | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/js/tmobile.js b/js/tmobile.js index 32603a6..24a0b00 100644 --- a/js/tmobile.js +++ b/js/tmobile.js @@ -488,6 +488,15 @@ function handleAvatarFileSelectMobile(evt) { } } +function openConversationClick(event) { + event.stopPropagation(); + event.preventDefault(); + + var userpost = $(event.target).closest(event.data.feeder).attr('data-userpost'); + + $.mobile.showPageLoadingMsg(); + $.mobile.navigate('#post?userpost=' + encodeURIComponent(userpost)); +} function clearProfilePage() { diff --git a/js/twister_formatpost.js b/js/twister_formatpost.js index 9c2db86..c09a9f5 100644 --- a/js/twister_formatpost.js +++ b/js/twister_formatpost.js @@ -120,7 +120,7 @@ function postToElem(post, kind, promoted) { .attr('data-content_to_sigrt', content_to_sigrt) .attr('data-screen-name', username) .attr('data-id', k) - .attr('data-lastk', userpost["lastk"]) + .attr('data-lastk', userpost.lastk) .attr('data-text', msg) ; if (userpost.reply) { @@ -170,6 +170,7 @@ function postToElem(post, kind, promoted) { .find('.post-rt-reference') .attr('data-screen-name', rt.n) .attr('data-id', rt.k) + .attr('data-userpost', $.toJSON({userpost: rt, sig_userpost: userpost.sig_rt})) .find('.post-text').html(htmlFormatMsg(rt.msg).html) ; setPostCommon(postContext, rt.n, rt.time);