Skip to content

Commit

Permalink
profile: delay jQuery calls until after page is really loaded
Browse files Browse the repository at this point in the history
I was getting `$(...).popover is not a function` on the JS console
because at the time .popover() is called, probably the other JS bits
haven't beed loaded.
  • Loading branch information
terceiro committed Dec 27, 2023
1 parent 55e4d8c commit 3efe460
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions wafer/users/templates/wafer.users/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
{% endblock content %}
{% block extra_foot %}
<script type="text/javascript">

$("#profile-avatar [rel=popover]").attr("data-bs-content", $("#profile-avatar .popover-contents").html());
$("a[rel=popover]").popover();
$(function() {
$("#profile-avatar [rel=popover]").attr("data-bs-content", $("#profile-avatar .popover-contents").html());
$("a[rel=popover]").popover();
})
</script>
{% endblock extra_foot %}

0 comments on commit 3efe460

Please sign in to comment.