better js for follower pages

master
Aevann1 2022-10-21 00:14:19 +02:00
parent 981256eb00
commit 25c5c8fb7d
3 changed files with 3 additions and 5 deletions

View File

@ -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();
}

View File

@ -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();
}

View File

@ -24,7 +24,7 @@
<td>{% include "user_in_table.html" %}</td>
<td {% if follow.created_utc > 1599343262 %}data-time="{{follow.created_utc}}"{% endif %}></td>
{% if v.id == u.id %}
<td><div class="btn btn-danger pr-2" onclick="removeFollower(this, '{{user.username}}')">Remove follow</div></td>
<td><div class="btn btn-danger" onclick="removeFollower(this, '{{user.username}}')">Remove follow</div></td>
{% endif %}
</tr>
{% endfor %}