diff options
author | Mario <mario@mariovavti.com> | 2020-11-22 13:07:03 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-11-22 13:07:03 +0000 |
commit | c0adf31da9a0d8f897dc68ab632c736891318ad5 (patch) | |
tree | e9b5756e05b9675d487d47bccc330ef2a67888e7 /view/js | |
parent | bb43c57b0731270d563dca8afb773b49e9023f54 (diff) | |
download | volse-hubzilla-c0adf31da9a0d8f897dc68ab632c736891318ad5.tar.gz volse-hubzilla-c0adf31da9a0d8f897dc68ab632c736891318ad5.tar.bz2 volse-hubzilla-c0adf31da9a0d8f897dc68ab632c736891318ad5.zip |
fix like issue with remote channels
Diffstat (limited to 'view/js')
-rw-r--r-- | view/js/main.js | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/view/js/main.js b/view/js/main.js index 0bc4261f5..4c8cd0adf 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -1149,30 +1149,28 @@ function justifyPhotosAjax(id) { function dolike(ident, verb) { $('#like-rotator-' + ident.toString()).show(); - if(! localUser) { - $.get('like/' + ident.toString() + '?verb=' + verb, updateInit); - } - else { - $.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.orig_id).hasClass('toplevel_item')) { - var wrapper = $('<div></div>').html( data.html ).find('#wall-item-outside-wrapper-' + data.id); - $('#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.orig_id).replaceWith(data.html); - } - $('#wall-item-ago-' + data.id + ' .autotime').timeago(); - collapseHeight(); - liking = 0; + if(typeof conv_mode == typeof undefined) + conv_mode = ''; + + $.get('like/' + ident.toString() + '?verb=' + verb + '&conv_mode=' + conv_mode, 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.orig_id).hasClass('toplevel_item')) { + var wrapper = $('<div></div>').html( data.html ).find('#wall-item-outside-wrapper-' + data.id); + $('#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.orig_id).replaceWith(data.html); + } + $('#wall-item-ago-' + data.id + ' .autotime').timeago(); + collapseHeight(); + liking = 0; + } + }); liking = 1; } |