aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-11-24 20:01:16 +0000
committerMario <mario@mariovavti.com>2021-11-24 20:01:16 +0000
commit668d7c73ede680862118331f64156d76c9fbadec (patch)
tree50183abf6e22c041142935a8b8a4707300645de7
parentc95f708c9174be3138d2cff133eaa210b7222cd6 (diff)
downloadvolse-hubzilla-668d7c73ede680862118331f64156d76c9fbadec.tar.gz
volse-hubzilla-668d7c73ede680862118331f64156d76c9fbadec.tar.bz2
volse-hubzilla-668d7c73ede680862118331f64156d76c9fbadec.zip
address issue #1651 (reload page after comment or like)
-rw-r--r--Zotlabs/Module/Like.php6
-rw-r--r--view/js/main.js23
2 files changed, 26 insertions, 3 deletions
diff --git a/Zotlabs/Module/Like.php b/Zotlabs/Module/Like.php
index e3fe4a954..8b36e8396 100644
--- a/Zotlabs/Module/Like.php
+++ b/Zotlabs/Module/Like.php
@@ -91,6 +91,12 @@ class Like extends Controller {
'id' => $arr['item']['id'],
'html' => conversation($items, $conv_mode, true, $page_mode),
];
+
+ // mod photos
+ if (isset($_REQUEST['reload']) && $_REQUEST['reload']) {
+ $ret['reload'] = 1;
+ }
+
return $ret;
}
diff --git a/view/js/main.js b/view/js/main.js
index d3f4eff9a..0e16809e4 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -1158,8 +1158,18 @@ function dolike(ident, verb) {
if(typeof page_mode == typeof undefined)
page_mode = '';
- $.get('like/' + ident.toString() + '?verb=' + verb + '&conv_mode=' + conv_mode + '&page_mode=' + page_mode, function (data) {
+ var reload = '';
+ if(module == 'photos')
+ reload = 1;
+
+ $.get('like/' + ident.toString() + '?verb=' + verb + '&conv_mode=' + conv_mode + '&page_mode=' + page_mode + '&reload=' + reload, function (data) {
if(data.success) {
+
+ // mod photos
+ if (data.reload) {
+ window.location.href = window.location.href;
+ }
+
// 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);
@@ -1381,7 +1391,14 @@ function post_comment(id) {
"item",
form_data + '&conv_mode=' + conv_mode,
function(data) {
- if(data.success) {
+ if (data.success) {
+
+ //mod photos
+ if (data.reload) {
+ window.location.href = data.reload;
+ }
+
+
localStorage.removeItem("comment_body-" + id);
$("#comment-edit-preview-" + id).hide();
$("#comment-edit-text-" + id).val('').blur().attr('placeholder', aStr.comment);
@@ -1392,7 +1409,7 @@ function post_comment(id) {
commentBusy = false;
var tarea = document.getElementById("comment-edit-text-" + id);
- if(tarea) {
+ if (tarea) {
commentClose(tarea, id);
$(document).off( "click.commentOpen");
}