From a8a3d42ca7cf75ce00008dbe8bcc4ac0a00e20b3 Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Wed, 23 Jan 2019 10:19:03 +0500 Subject: [PATCH] fix showing of tmobile's single post --- js/tmobile.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/js/tmobile.js b/js/tmobile.js index d64a061..7a7dcc1 100644 --- a/js/tmobile.js +++ b/js/tmobile.js @@ -169,11 +169,14 @@ var router=new $.mobile.Router( }); }, post: function(type,match,ui) { - var params=router.getParams(match[1]); - initializeTwister( true, true, function() { + initializeTwister( true, true, function (req) { + if (!req || !req.userpost) return; + + var originalLi = postToElem(JSON.parse(req.userpost), 'original', false, twister.tmpl.postFull) + .addClass('expanded-post') + ; var $ulPost = $("#post ul.posts"); $ulPost.text(""); - var originalLi = postToElem(JSON.parse(params.userpost), 'original', false, twister.tmpl.postFull); $ulPost.append(originalLi); $ulPost.find(".post-interactions").trigger('create'); $ulPost.listview('refresh'); @@ -185,7 +188,7 @@ var router=new $.mobile.Router( // RTs faces and counter var postDataElem = originalLi.find('.post-data'); requestRTs(postDataElem.attr('data-screen-name'), postDataElem.attr('data-id')); - }); + }, router.getParams(match[1])); }, newmsg: function(type,match,ui) { var params=router.getParams(match[1]);