From 25c5c8fb7d3e7a14dcb99fe59541893ce580d45d Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 21 Oct 2022 00:14:19 +0200 Subject: [PATCH] better js for follower pages --- files/assets/js/followers.js | 3 +-- files/assets/js/following.js | 3 +-- files/templates/followers.html | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/files/assets/js/followers.js b/files/assets/js/followers.js index 1cd91efe6..d237e5905 100644 --- a/files/assets/js/followers.js +++ b/files/assets/js/followers.js @@ -1,5 +1,4 @@ function removeFollower(t, username) { post_toast(t,'/remove_follow/' + username); - let table = document.getElementById("followers-table"); - table.removeChild(t.parentElement.parentElement); + t.parentElement.parentElement.remove(); } diff --git a/files/assets/js/following.js b/files/assets/js/following.js index 2ecd50891..ba846496c 100644 --- a/files/assets/js/following.js +++ b/files/assets/js/following.js @@ -1,5 +1,4 @@ function removeFollowing(t, username) { post_toast(t,'/unfollow/' + username); - let table = document.getElementById("followers-table"); - table.removeChild(t.parentElement.parentElement); + t.parentElement.parentElement.remove(); } diff --git a/files/templates/followers.html b/files/templates/followers.html index 10979a379..e0cd25583 100644 --- a/files/templates/followers.html +++ b/files/templates/followers.html @@ -24,7 +24,7 @@ {% include "user_in_table.html" %} 1599343262 %}data-time="{{follow.created_utc}}"{% endif %}> {% if v.id == u.id %} -
Remove follow
+
Remove follow
{% endif %} {% endfor %}