mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2026-10-26 16:45:18 +00:00
Merge pull request #7925 from austinhardaway/fix-collection-multi-select
Fix Multiselect not working in collections
This commit is contained in:
1 parent
af9fa7b0be
commit
11e468aee7
2 files changed
+14
-1
No files matched your search
@@ -107,6 +107,7 @@
|
||||
- [Lampan-git](https://github.com/Lampan-git)
|
||||
- [lmaotrigine](https://github.com/lmaotrigine)
|
||||
- [bjorntp](https://github.com/bjorntp)
|
||||
- [austinhardaway](https://github.com/austinhardaway)
|
||||
|
||||
## Emby Contributors
|
||||
|
||||
|
||||
@@ -55,7 +55,14 @@ function onItemSelectionPanelClick(e, itemSelectionPanel) {
|
||||
}
|
||||
|
||||
function updateItemSelection(chkItemSelect, selected) {
|
||||
const id = dom.parentWithAttribute(chkItemSelect, 'data-id').getAttribute('data-id');
|
||||
const parentWithId = dom.parentWithAttribute(chkItemSelect, 'data-id');
|
||||
|
||||
// If the element doesn't have a parent with data-id, it's not a valid item
|
||||
if (!parentWithId) {
|
||||
return;
|
||||
}
|
||||
|
||||
const id = parentWithId.getAttribute('data-id');
|
||||
|
||||
if (selected) {
|
||||
const current = selectedItems.filter(i => {
|
||||
@@ -90,6 +97,11 @@ function onSelectionChange() {
|
||||
}
|
||||
|
||||
function showSelection(item, isChecked, addInitialCheck) {
|
||||
// Only add selection checkbox if the item has a data-id attribute
|
||||
if (!dom.parentWithAttribute(item, 'data-id')) {
|
||||
return;
|
||||
}
|
||||
|
||||
let itemSelectionPanel = item.querySelector('.itemSelectionPanel');
|
||||
|
||||
if (!itemSelectionPanel) {
|
||||
|
||||
Reference in new issue
Block a user