Browse Source

Fix shift-rangeselect on sorted list view

master
jeffvli 3 years ago
committed by Jeff
parent
commit
d6efbf080a
  1. 4
      src/components/library/AlbumList.tsx
  2. 4
      src/components/library/AlbumView.tsx
  3. 4
      src/components/library/ArtistList.tsx
  4. 4
      src/components/library/ArtistView.tsx
  5. 4
      src/components/library/FolderList.tsx
  6. 4
      src/components/library/GenreList.tsx
  7. 4
      src/components/player/NowPlayingMiniView.tsx
  8. 4
      src/components/player/NowPlayingView.tsx
  9. 4
      src/components/playlist/PlaylistList.tsx
  10. 8
      src/components/playlist/PlaylistView.tsx
  11. 4
      src/components/search/SearchView.tsx
  12. 4
      src/components/settings/ConfigPanels/ListViewConfig.tsx
  13. 4
      src/components/starred/StarredView.tsx
  14. 36
      src/components/viewtypes/ListViewTable.tsx

4
src/components/library/AlbumList.tsx

@ -90,7 +90,7 @@ const AlbumList = () => {
}, [genres]);
let timeout: any = null;
const handleRowClick = (e: any, rowData: any) => {
const handleRowClick = (e: any, rowData: any, tableData: any) => {
if (timeout === null) {
timeout = window.setTimeout(() => {
timeout = null;
@ -99,7 +99,7 @@ const AlbumList = () => {
dispatch(toggleSelected(rowData));
} else if (e.shiftKey) {
dispatch(setRangeSelected(rowData));
dispatch(toggleRangeSelected(searchQuery !== '' ? filteredData : albums));
dispatch(toggleRangeSelected(tableData));
}
}, 100);
}

4
src/components/library/AlbumView.tsx

@ -64,7 +64,7 @@ const AlbumView = ({ ...rest }: any) => {
]);
let timeout: any = null;
const handleRowClick = (e: any, rowData: any) => {
const handleRowClick = (e: any, rowData: any, tableData: any) => {
if (timeout === null) {
timeout = window.setTimeout(() => {
timeout = null;
@ -73,7 +73,7 @@ const AlbumView = ({ ...rest }: any) => {
dispatch(toggleSelected(rowData));
} else if (e.shiftKey) {
dispatch(setRangeSelected(rowData));
dispatch(toggleRangeSelected(searchQuery !== '' ? filteredData : data.song));
dispatch(toggleRangeSelected(tableData));
}
}, 100);
}

4
src/components/library/ArtistList.tsx

@ -48,7 +48,7 @@ const ArtistList = () => {
const filteredData = useSearchQuery(searchQuery, artists, ['name']);
let timeout: any = null;
const handleRowClick = (e: any, rowData: any) => {
const handleRowClick = (e: any, rowData: any, tableData: any) => {
if (timeout === null) {
timeout = window.setTimeout(() => {
timeout = null;
@ -57,7 +57,7 @@ const ArtistList = () => {
dispatch(toggleSelected(rowData));
} else if (e.shiftKey) {
dispatch(setRangeSelected(rowData));
dispatch(toggleRangeSelected(searchQuery !== '' ? filteredData : artists));
dispatch(toggleRangeSelected(tableData));
}
}, 100);
}

4
src/components/library/ArtistView.tsx

@ -68,7 +68,7 @@ const ArtistView = ({ ...rest }: any) => {
]);
let timeout: any = null;
const handleRowClick = (e: any, rowData: any) => {
const handleRowClick = (e: any, rowData: any, tableData: any) => {
if (timeout === null) {
timeout = window.setTimeout(() => {
timeout = null;
@ -77,7 +77,7 @@ const ArtistView = ({ ...rest }: any) => {
dispatch(toggleSelected(rowData));
} else if (e.shiftKey) {
dispatch(setRangeSelected(rowData));
dispatch(toggleRangeSelected(searchQuery !== '' ? filteredData : data.album));
dispatch(toggleRangeSelected(tableData));
}
}, 100);
}

4
src/components/library/FolderList.tsx

@ -69,7 +69,7 @@ const FolderList = () => {
}, [dispatch, query]);
let timeout: any = null;
const handleRowClick = (e: any, rowData: any) => {
const handleRowClick = (e: any, rowData: any, tableData: any) => {
if (timeout === null) {
timeout = window.setTimeout(() => {
timeout = null;
@ -78,7 +78,7 @@ const FolderList = () => {
dispatch(toggleSelected(rowData));
} else if (e.shiftKey) {
dispatch(setRangeSelected(rowData));
dispatch(toggleRangeSelected(folderData.child));
dispatch(toggleRangeSelected(tableData));
}
}, 100);
}

4
src/components/library/GenreList.tsx

@ -29,7 +29,7 @@ const GenreList = () => {
const filteredData = useSearchQuery(searchQuery, genres, ['value']);
let timeout: any = null;
const handleRowClick = (e: any, rowData: any) => {
const handleRowClick = (e: any, rowData: any, tableData: any) => {
if (timeout === null) {
timeout = window.setTimeout(() => {
timeout = null;
@ -38,7 +38,7 @@ const GenreList = () => {
dispatch(toggleSelected(rowData));
} else if (e.shiftKey) {
dispatch(setRangeSelected(rowData));
dispatch(toggleRangeSelected(searchQuery !== '' ? filteredData : genres));
dispatch(toggleRangeSelected(tableData));
}
}, 100);
}

4
src/components/player/NowPlayingMiniView.tsx

@ -74,7 +74,7 @@ const NowPlayingMiniView = () => {
}, [playQueue.currentIndex, tableRef, playQueue.displayQueue, playQueue.scrollWithCurrentSong]);
let timeout: any = null;
const handleRowClick = (e: any, rowData: any) => {
const handleRowClick = (e: any, rowData: any, tableData: any) => {
if (timeout === null) {
timeout = window.setTimeout(() => {
timeout = null;
@ -83,7 +83,7 @@ const NowPlayingMiniView = () => {
dispatch(toggleSelected(rowData));
} else if (e.shiftKey) {
dispatch(setRangeSelected(rowData));
dispatch(toggleRangeSelected(playQueue[getCurrentEntryList(playQueue)]));
dispatch(toggleRangeSelected(tableData));
}
}, 100);
}

4
src/components/player/NowPlayingView.tsx

@ -118,7 +118,7 @@ const NowPlayingView = () => {
}, [playQueue.currentIndex, playQueue.scrollWithCurrentSong, tableRef]);
let timeout: any = null;
const handleRowClick = (e: any, rowData: any) => {
const handleRowClick = (e: any, rowData: any, tableData: any) => {
if (timeout === null) {
timeout = window.setTimeout(() => {
timeout = null;
@ -130,7 +130,7 @@ const NowPlayingView = () => {
if (searchQuery !== '') {
dispatch(toggleRangeSelected(filteredData));
} else {
dispatch(toggleRangeSelected(playQueue[getCurrentEntryList(playQueue)]));
dispatch(toggleRangeSelected(tableData));
}
}
}, 100);

4
src/components/playlist/PlaylistList.tsx

@ -58,7 +58,7 @@ const PlaylistList = () => {
};
let timeout: any = null;
const handleRowClick = (e: any, rowData: any) => {
const handleRowClick = (e: any, rowData: any, tableData: any) => {
if (timeout === null) {
timeout = window.setTimeout(() => {
timeout = null;
@ -67,7 +67,7 @@ const PlaylistList = () => {
dispatch(toggleSelected(rowData));
} else if (e.shiftKey) {
dispatch(setRangeSelected(rowData));
dispatch(toggleRangeSelected(searchQuery !== '' ? filteredData : playlists));
dispatch(toggleRangeSelected(tableData));
}
}, 100);
}

8
src/components/playlist/PlaylistView.tsx

@ -138,7 +138,7 @@ const PlaylistView = ({ ...rest }) => {
}, [data?.song, playlist]);
let timeout: any = null;
const handleRowClick = (e: any, rowData: any) => {
const handleRowClick = (e: any, rowData: any, tableData: any) => {
if (timeout === null) {
timeout = window.setTimeout(() => {
timeout = null;
@ -147,11 +147,7 @@ const PlaylistView = ({ ...rest }) => {
dispatch(toggleSelected(rowData));
} else if (e.shiftKey) {
dispatch(setRangeSelected(rowData));
dispatch(
toggleRangeSelected(
searchQuery !== '' ? filteredData : playlist[getCurrentEntryList(playlist)]
)
);
dispatch(toggleRangeSelected(tableData));
}
}, 100);
}

4
src/components/search/SearchView.tsx

@ -44,7 +44,7 @@ const SearchView = () => {
);
let timeout: any = null;
const handleRowClick = (e: any, rowData: any) => {
const handleRowClick = (e: any, rowData: any, tableData: any) => {
if (timeout === null) {
timeout = window.setTimeout(() => {
timeout = null;
@ -53,7 +53,7 @@ const SearchView = () => {
dispatch(toggleSelected(rowData));
} else if (e.shiftKey) {
dispatch(setRangeSelected(rowData));
dispatch(toggleRangeSelected(data.song));
dispatch(toggleRangeSelected(tableData));
}
}, 100);
}

4
src/components/settings/ConfigPanels/ListViewConfig.tsx

@ -68,7 +68,7 @@ const ListViewConfig = ({ defaultColumns, columnPicker, columnList, settingsConf
}, [columnListType, config.lookAndFeel.listView, settingsConfig.columnList]);
let timeout: any = null;
const handleRowClick = (e: any, rowData: any) => {
const handleRowClick = (e: any, rowData: any, tableData: any) => {
if (timeout === null) {
timeout = window.setTimeout(() => {
timeout = null;
@ -77,7 +77,7 @@ const ListViewConfig = ({ defaultColumns, columnPicker, columnList, settingsConf
dispatch(toggleSelected(rowData));
} else if (e.shiftKey) {
dispatch(setRangeSelected(rowData));
dispatch(toggleRangeSelected(config.lookAndFeel.listView[columnListType].columns));
dispatch(toggleRangeSelected(tableData));
}
}, 100);
}

4
src/components/starred/StarredView.tsx

@ -57,7 +57,7 @@ const StarredView = () => {
);
let timeout: any = null;
const handleRowClick = (e: any, rowData: any) => {
const handleRowClick = (e: any, rowData: any, tableData: any) => {
if (timeout === null) {
timeout = window.setTimeout(() => {
timeout = null;
@ -74,7 +74,7 @@ const StarredView = () => {
}
} else if (favorite.active.tab === 'albums') {
dispatch(setRangeSelected(rowData));
dispatch(toggleRangeSelected(searchQuery !== '' ? filteredData : data?.album));
dispatch(toggleRangeSelected(tableData));
}
}
}, 100);

36
src/components/viewtypes/ListViewTable.tsx

@ -429,10 +429,14 @@ const ListViewTable = ({
height={rowHeight}
onClick={(e: any) => {
if (!dnd) {
handleRowClick(e, {
...rowData,
rowIndex,
});
handleRowClick(
e,
{
...rowData,
rowIndex,
},
sortColumn && !nowPlaying ? sortedData : data
);
}
}}
onDoubleClick={() => {
@ -529,10 +533,14 @@ const ListViewTable = ({
return (
<TableCellWrapper
onClick={(e: any) =>
handleRowClick(e, {
...rowData,
rowIndex,
})
handleRowClick(
e,
{
...rowData,
rowIndex,
},
sortColumn && !nowPlaying ? sortedData : data
)
}
onDoubleClick={() =>
handleRowDoubleClick({
@ -752,10 +760,14 @@ const ListViewTable = ({
/starred|userRating|columnResizable|columnDefaultSort/
)
) {
handleRowClick(e, {
...rowData,
rowIndex,
});
handleRowClick(
e,
{
...rowData,
rowIndex,
},
sortColumn && !nowPlaying ? sortedData : data
);
}
}}
onDoubleClick={() => {

Loading…
Cancel
Save