mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Group popout "improvements"
This commit is contained in:
@ -993,27 +993,29 @@ function printGroupCandidates() {
|
||||
|
||||
function printGroupMembers() {
|
||||
const storageKey = 'GroupMembers_PerPage';
|
||||
$("#rm_group_members_pagination").pagination({
|
||||
dataSource: getGroupCharacters({ doFilter: false, onlyMembers: true }),
|
||||
pageRange: 1,
|
||||
position: 'top',
|
||||
showPageNumbers: false,
|
||||
prevText: '<',
|
||||
nextText: '>',
|
||||
formatNavigator: PAGINATION_TEMPLATE,
|
||||
showNavigator: true,
|
||||
showSizeChanger: true,
|
||||
pageSize: Number(localStorage.getItem(storageKey)) || 5,
|
||||
sizeChangerOptions: [5, 10, 25, 50, 100, 200],
|
||||
afterSizeSelectorChange: function (e) {
|
||||
localStorage.setItem(storageKey, e.target.value);
|
||||
},
|
||||
callback: function (data) {
|
||||
$("#rm_group_members").empty();
|
||||
for (const i of data) {
|
||||
$("#rm_group_members").append(getGroupCharacterBlock(i.item));
|
||||
}
|
||||
},
|
||||
$(".rm_group_members_pagination").each(function() {
|
||||
$(this).pagination({
|
||||
dataSource: getGroupCharacters({ doFilter: false, onlyMembers: true }),
|
||||
pageRange: 1,
|
||||
position: 'top',
|
||||
showPageNumbers: false,
|
||||
prevText: '<',
|
||||
nextText: '>',
|
||||
formatNavigator: PAGINATION_TEMPLATE,
|
||||
showNavigator: true,
|
||||
showSizeChanger: true,
|
||||
pageSize: Number(localStorage.getItem(storageKey)) || 5,
|
||||
sizeChangerOptions: [5, 10, 25, 50, 100, 200],
|
||||
afterSizeSelectorChange: function (e) {
|
||||
localStorage.setItem(storageKey, e.target.value);
|
||||
},
|
||||
callback: function (data) {
|
||||
$(".rm_group_members").empty();
|
||||
for (const i of data) {
|
||||
$(".rm_group_members").append(getGroupCharacterBlock(i.item));
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@ -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() });
|
||||
|
Reference in New Issue
Block a user