mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-09 19:52:20 +01:00
Replace shift shit with array filter
Co-Authored-By: Olaf Slomp <git@oslomp.nl>
This commit is contained in:
@ -463,12 +463,11 @@
|
|||||||
toggle_details(song) {
|
toggle_details(song) {
|
||||||
if (!this.show_details(song)) {
|
if (!this.show_details(song)) {
|
||||||
this.songs_show_details_on_mobile.push(song.id);
|
this.songs_show_details_on_mobile.push(song.id);
|
||||||
}
|
} else {
|
||||||
else {
|
// Deze filter is gehaat door Kees, gemaakt door Olaf. Bedankt, Olaf. Duurde wel even.
|
||||||
const index = this.songs_show_details_on_mobile.indexOf(song.id);
|
this.songs_show_details_on_mobile = this.songs_show_details_on_mobile.filter(
|
||||||
if (index > -1) {
|
value => value !== song.id
|
||||||
this.songs_show_details_on_mobile.splice(index, 1);
|
);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user