1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Merge pull request #6027 from viown/fix-double-select

Fix double click to uncheck in multi-select menu
This commit is contained in:
Bill Thornton 2024-09-20 17:26:41 -04:00 committed by GitHub
commit 04dbfd30e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -87,7 +87,7 @@ function onSelectionChange() {
updateItemSelection(this, this.checked);
}
function showSelection(item, isChecked) {
function showSelection(item, isChecked, addInitialCheck) {
let itemSelectionPanel = item.querySelector('.itemSelectionPanel');
if (!itemSelectionPanel) {
@ -99,7 +99,7 @@ function showSelection(item, isChecked) {
parent.appendChild(itemSelectionPanel);
let cssClass = 'chkItemSelect';
if (isChecked) {
if (isChecked && addInitialCheck) {
cssClass += ' checkedInitial';
}
const checkedAttribute = isChecked ? ' checked' : '';
@ -361,11 +361,11 @@ function combineVersions(apiClient, selection) {
});
}
function showSelections(initialCard) {
function showSelections(initialCard, addInitialCheck) {
import('../../elements/emby-checkbox/emby-checkbox').then(() => {
const cards = document.querySelectorAll('.card');
for (let i = 0, length = cards.length; i < length; i++) {
showSelection(cards[i], initialCard === cards[i]);
showSelection(cards[i], initialCard === cards[i], addInitialCheck);
}
showSelectionCommands();
@ -402,7 +402,7 @@ export default function (options) {
const card = dom.parentWithClass(e.target, 'card');
if (card) {
showSelections(card);
showSelections(card, true);
}
e.preventDefault();
@ -500,7 +500,7 @@ export default function (options) {
touchTarget = null;
if (card) {
showSelections(card);
showSelections(card, true);
}
}
@ -569,7 +569,7 @@ export default function (options) {
}
export const startMultiSelect = (card) => {
showSelections(card);
showSelections(card, false);
};
export const stopMultiSelect = () => {