Member Directory Gadget Customization Issue
I am encountering an issue within the Member Directory Gadget. The thing is, I have added a customization on my member directory gadget on this page: https://grn.global/Public-Members-Directory/
So in my code, I am trying to wrap every 3 <tr> element in the members table element which I was able to achieve in my code. It works at first load of the site when you visit after sometime and also if you hard reload the page. But if you just refresh it normally or if you're logged in(backend), its either the code doesn't work anymore, not loaded, or removed.
It would really be a big help knowing what's causing the problem. Here is the code I added on the Global Javascript:
<script type="text/javascript">
jq$(window).on('load', function(){
var tRows = jq$('.WaGadgetMemberDirectory .memberDirectoryContainer table#membersTable > tbody tr');
for(var i = 0; i < tRows.length; i+=2) {
tRows.slice(i, i+2).wrapAll("<tbody class='memberItem-wrapper'></tbody>"); }
jq$('.WaGadgetMemberDirectory .memberDirectoryContainer table#membersTable > tbody tbody.memberItem-wrapper tr:first-child .memberDirectoryColumn2').append('<span class="member-dir-toFullProfile">See full profile</span>');
});
</script>