diff options
author | Mario <mario@mariovavti.com> | 2020-11-21 10:22:23 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-11-21 10:22:23 +0000 |
commit | f74cfaec5f48ec37cc1f51e5381a45998ebc70e3 (patch) | |
tree | beddb41230348bb597a6312e1a609848014a8c2b /view/js | |
parent | d559b4a2017e58c1dd24684c329327e935452e64 (diff) | |
download | volse-hubzilla-f74cfaec5f48ec37cc1f51e5381a45998ebc70e3.tar.gz volse-hubzilla-f74cfaec5f48ec37cc1f51e5381a45998ebc70e3.tar.bz2 volse-hubzilla-f74cfaec5f48ec37cc1f51e5381a45998ebc70e3.zip |
fix pubstream id issue
Diffstat (limited to 'view/js')
-rw-r--r-- | view/js/main.js | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/view/js/main.js b/view/js/main.js index 133d71863..b7cfb75db 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -1146,27 +1146,21 @@ function justifyPhotosAjax(id) { $('#' + id).justifiedGallery('norewind').on('jg.complete', function(e){ justifiedGalleryActive = false; }); } -// Since our ajax calls are asynchronous, we will give a few -// seconds for the first ajax call (setting like/dislike), then -// run the updater to pick up any changes and display on the page. -// The updater will turn any rotators off when it's done. -// This function will have returned long before any of these -// events have completed and therefore there won't be any -// visible feedback that anything changed without all this -// trickery. This still could cause confusion if the "like" ajax call -// is delayed and updateInit runs before it completes. function dolike(ident, verb) { $('#like-rotator-' + ident.toString()).show(); $.get('like/' + ident.toString() + '?verb=' + verb, function (data) { data = JSON.parse(data); if(data.success) { // this is a bit tricky since the top level thread wrapper wraps the whole thread - if($('#thread-wrapper-' + data.id).hasClass('toplevel_item')) { + if($('#thread-wrapper-' + data.orig_id).hasClass('toplevel_item')) { var wrapper = $('<div></div>').html( data.html ).find('#wall-item-outside-wrapper-' + data.id); - $('#wall-item-outside-wrapper-' + data.id).html(wrapper[0].innerHTML); + $('#wall-item-outside-wrapper-' + data.orig_id).html(wrapper[0].innerHTML); + // those were not replaced - swap the id + $('#thread-wrapper-' + data.orig_id).attr('id', 'thread-wrapper-' + data.id); + $('#wall-item-outside-wrapper-' + data.orig_id).attr('id', 'wall-item-outside-wrapper-' + data.id); } else { - $('#thread-wrapper-' + data.id).replaceWith(data.html); + $('#thread-wrapper-' + data.orig_id).replaceWith(data.html); } $('#wall-item-ago-' + data.id + ' .autotime').timeago(); liking = 0; |