multiselect partially working
This commit is contained in:
parent
2100021e7b
commit
0170a97a1e
2 changed files with 49 additions and 36 deletions
|
|
@ -142,33 +142,6 @@ watch(isCompareModeEnabled, (newValue) => {
|
|||
}
|
||||
});
|
||||
|
||||
function selectTrack(track) {
|
||||
if (!isCompareModeEnabled.value) {
|
||||
activeTracks.value = [track];
|
||||
return;
|
||||
}
|
||||
|
||||
if (activeTracks.value.length === 1 && !activeTracks.value.includes(track)) {
|
||||
activeTracks.value.push(track);
|
||||
return;
|
||||
}
|
||||
|
||||
if (activeTracks.value.length === 2) {
|
||||
if (activeTracks.value.includes(track)) {
|
||||
removeTrack(track);
|
||||
} else {
|
||||
activeTracks.value.pop();
|
||||
activeTracks.value.push(track);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function removeTrack(track) {
|
||||
activeTracks.value = activeTracks.value.filter(
|
||||
(activeTrack) => activeTrack.title !== track.title
|
||||
);
|
||||
}
|
||||
|
||||
function getCommentsCount(track) {
|
||||
let count = 0;
|
||||
for (const file of track.files) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue