Group popout "improvements"

This commit is contained in:
Cohee 2023-10-15 19:42:23 +03:00
parent 421cda2ef0
commit 6e6e5f4747
4 changed files with 39 additions and 26 deletions

View File

@ -226,4 +226,5 @@
.group_member .avatar {
flex-shrink: 0;
flex-basis: auto;
}

View File

@ -3611,9 +3611,9 @@
<div class="fa-solid fa-circle-chevron-down inline-drawer-icon down"></div>
</div>
<div class="inline-drawer-content">
<div name="Current Group Members" class="flex-container flexFlowColumn overflowYAuto flex1">
<div id="rm_group_members_pagination" class="group_pagination"></div>
<div id="rm_group_members" class="overflowYAuto flex-container"></div>
<div id="currentGroupMembers" name="Current Group Members" class="flex-container flexFlowColumn overflowYAuto flex1">
<div id="rm_group_members_pagination" class="rm_group_members_pagination group_pagination"></div>
<div id="rm_group_members" class="rm_group_members overflowYAuto flex-container"></div>
</div>
</div>
</div>

View File

@ -993,7 +993,8 @@ function printGroupCandidates() {
function printGroupMembers() {
const storageKey = 'GroupMembers_PerPage';
$("#rm_group_members_pagination").pagination({
$(".rm_group_members_pagination").each(function() {
$(this).pagination({
dataSource: getGroupCharacters({ doFilter: false, onlyMembers: true }),
pageRange: 1,
position: 'top',
@ -1009,12 +1010,13 @@ function printGroupMembers() {
localStorage.setItem(storageKey, e.target.value);
},
callback: function (data) {
$("#rm_group_members").empty();
$(".rm_group_members").empty();
for (const i of data) {
$("#rm_group_members").append(getGroupCharacterBlock(i.item));
$(".rm_group_members").append(getGroupCharacterBlock(i.item));
}
},
});
});
}
function getGroupCharacterBlock(character) {
@ -1563,6 +1565,9 @@ function doCurMemberListPopout() {
.append(controlBarHtml)
.append(memberListClone)
// Remove pagination from popout
newElement.find('.group_pagination').empty();
$('body').append(newElement);
loadMovingUIState();
$("#groupMemberListPopout").fadeIn(250)
@ -1571,6 +1576,8 @@ function doCurMemberListPopout() {
$("#groupMemberListPopout").fadeOut(250, () => { $("#groupMemberListPopout").remove() })
})
// Re-add pagination not working in popout
printGroupMembers();
} else {
console.debug('saw existing popout, removing')
$("#groupMemberListPopout").fadeOut(250, () => { $("#groupMemberListPopout").remove() });

View File

@ -3474,6 +3474,11 @@ a {
#groupMemberListPopout {
padding: 0;
height: 50%;
}
#groupMemberListPopout #currentGroupMembers {
height: 100%;
}
#groupMemberListPopout #rm_group_members {