select first option in sort dropdown by default
+ center items in dropdown
This commit is contained in:
parent
c665be6836
commit
7a6699b329
2 changed files with 5 additions and 2 deletions
6
js/ui.js
6
js/ui.js
|
|
@ -2161,8 +2161,10 @@ export class UIRenderer {
|
|||
descEl.textContent = playlistData.description || '';
|
||||
|
||||
const originalTracks = [...tracks];
|
||||
let currentTracks = [...tracks];
|
||||
currentSort = 'custom';
|
||||
// Default sort: first available option (Playlist Order if no addedAt, else Date Added Newest)
|
||||
const hasAddedDate = tracks.some((t) => t.addedAt);
|
||||
currentSort = hasAddedDate ? 'added-newest' : 'custom';
|
||||
let currentTracks = sortTracks(originalTracks, currentSort);
|
||||
|
||||
const renderTracks = () => {
|
||||
// Re-fetch container each time because enableTrackReordering clones it
|
||||
|
|
|
|||
|
|
@ -2202,6 +2202,7 @@ input:checked + .slider::before {
|
|||
#context-menu li,
|
||||
#sort-menu li {
|
||||
padding: 0.5rem 0.75rem;
|
||||
margin-right: 8px;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
transition:
|
||||
|
|
|
|||
Loading…
Reference in a new issue