keep track's artists order the same in subcontext menu
This commit is contained in:
parent
8be0fa944b
commit
be7ca88221
1 changed files with 3 additions and 5 deletions
|
|
@ -1800,9 +1800,7 @@ export function initializeTrackInteractions(player, api, mainContent, contextMen
|
||||||
|
|
||||||
// Render sub-menu
|
// Render sub-menu
|
||||||
let subMenuHTML = '<li data-action="back-to-main-menu" style="font-weight: bold; border-bottom: 1px solid var(--border); margin-bottom: 0.5rem; padding: 0.75rem 1rem; cursor: pointer;">← Back</li>';
|
let subMenuHTML = '<li data-action="back-to-main-menu" style="font-weight: bold; border-bottom: 1px solid var(--border); margin-bottom: 0.5rem; padding: 0.75rem 1rem; cursor: pointer;">← Back</li>';
|
||||||
[...artists]
|
artists.forEach((artist) => {
|
||||||
.sort((a, b) => (a.name || '').localeCompare(b.name || ''))
|
|
||||||
.forEach((artist) => {
|
|
||||||
subMenuHTML += `<li data-action="go-to-artist" data-artist-id="${artist.id}" style="padding: 0.75rem 1rem; cursor: pointer;">${escapeHtml(artist.name || 'Unknown Artist')}</li>`;
|
subMenuHTML += `<li data-action="go-to-artist" data-artist-id="${artist.id}" style="padding: 0.75rem 1rem; cursor: pointer;">${escapeHtml(artist.name || 'Unknown Artist')}</li>`;
|
||||||
});
|
});
|
||||||
contextMenu.innerHTML = `<ul>${subMenuHTML}</ul>`;
|
contextMenu.innerHTML = `<ul>${subMenuHTML}</ul>`;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue