Improve Infinite Scroll functionality- handle List View and other view options

This commit is contained in:
HighImKevin committed 2026-10-25 17:08:21 -04:00
1 parent 7d010c81e4
commit 0cd35f5b16
7 files changed
+528 -42

No files matched your search

+15 -3
View File
@@ -11,7 +11,8 @@
function defaultOptions() {
return {
hidePageControls: false,
onlyShowTotalItemCount: false
onlyShowTotalItemCount: false,
showFollowingAlphaLetters: false
};
}
@@ -22,7 +23,8 @@
}
return {
hidePageControls: config.hidePageControls === true,
onlyShowTotalItemCount: config.onlyShowTotalItemCount === true
onlyShowTotalItemCount: config.onlyShowTotalItemCount === true,
showFollowingAlphaLetters: config.showFollowingAlphaLetters === true
};
}
@@ -65,6 +67,10 @@
infiniteScroll_onlyShowTotalItemCount: {
on: 'The "1 of 100" text will be hidden in favor of just showing the total item count of the library',
off: 'The paginated item count is unchanged.'
},
infiniteScroll_showFollowingAlphaLetters: {
on: 'The Alpha Picker loads items from the Letter chosen, and all following letters.',
off: 'The Alpha Picker filters to only show items whose name starts with the chosen letter.'
}
};
@@ -113,6 +119,11 @@
config.onlyShowTotalItemCount === true,
'Only Show Total Item Count'
)}
${buildToggleCard(
'infiniteScroll_showFollowingAlphaLetters',
config.showFollowingAlphaLetters === true,
'Show items from Letters following the one selected in the Alpha Picker'
)}
</div>
`;
}
@@ -120,7 +131,8 @@
function collectConfig() {
return {
hidePageControls: document.getElementById('infiniteScroll_hidePageControls')?.checked === true,
onlyShowTotalItemCount: document.getElementById('infiniteScroll_onlyShowTotalItemCount')?.checked === true
onlyShowTotalItemCount: document.getElementById('infiniteScroll_onlyShowTotalItemCount')?.checked === true,
showFollowingAlphaLetters: document.getElementById('infiniteScroll_showFollowingAlphaLetters')?.checked === true
};
}
+9 -5
View File
@@ -458,6 +458,14 @@
<button type="button" class="emby-button raised" id="um-tag-cancel">Cancel</button>
<button type="button" class="emby-button raised button-submit" id="um-tag-ok">Add</button>`;
let settled = false;
const finish = (val) => {
if (settled) return;
settled = true;
window.ModalSystem.close(TAG_MODAL_ID);
resolve(val);
};
const modal = window.ModalSystem.create({
id: TAG_MODAL_ID,
title,
@@ -469,10 +477,6 @@
dialogStyle: { maxWidth: '420px', width: '90vw' },
onOpen: (m) => {
const input = m.dialogContent.querySelector('#um-tag-input');
const finish = (val) => {
window.ModalSystem.close(TAG_MODAL_ID);
resolve(val);
};
m.dialogFooter.querySelector('#um-tag-cancel')?.addEventListener('click', () => finish(null));
m.dialogFooter.querySelector('#um-tag-ok')?.addEventListener('click', () => {
finish(input?.value?.trim() || null);
@@ -485,7 +489,7 @@
});
setTimeout(() => input?.focus(), 50);
},
onClose: () => resolve(null)
onClose: () => finish(null)
});
});
}