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

- add "Select All" action to multiSelect

This commit is contained in:
Marius Luca 2022-01-05 12:37:46 +02:00
parent bb13952814
commit 8679e37222
2 changed files with 21 additions and 1 deletions

View file

@ -175,6 +175,12 @@ import itemHelper from '../itemHelper';
apiClient.getItem(apiClient.getCurrentUserId(), selectedItems[0]).then(firstItem => {
const menuItems = [];
menuItems.push({
name: globalize.translate('SelectAll'),
id: 'selectall',
icon: 'select_all'
});
menuItems.push({
name: globalize.translate('AddToCollection'),
id: 'addtocollection',
@ -246,6 +252,19 @@ import itemHelper from '../itemHelper';
const serverId = apiClient.serverInfo().Id;
switch (id) {
case 'selectall':
{
const elems = document.querySelectorAll('.itemSelectionPanel');
for (let i = 0, length = elems.length; i < length; i++) {
const chkItemSelect = elems[i].querySelector('.chkItemSelect');
if (chkItemSelect && !chkItemSelect.classList.contains('checkedInitial') && !chkItemSelect.checked && chkItemSelect.getBoundingClientRect().width != 0) {
chkItemSelect.checked = true;
updateItemSelection(chkItemSelect, true);
}
}
}
break;
case 'addtocollection':
import('../collectionEditor/collectionEditor').then(({default: collectionEditor}) => {
new collectionEditor({

View file

@ -1606,5 +1606,6 @@
"VideoBitrateNotSupported": "The video's bitrate is not supported",
"UnknownVideoStreamInfo": "The video stream info is unknown",
"UnknownAudioStreamInfo": "The audio stream info is unknown",
"DirectPlayError": "There was an error starting direct playback"
"DirectPlayError": "There was an error starting direct playback",
"SelectAll": "Select All"
}