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 || '';
|
descEl.textContent = playlistData.description || '';
|
||||||
|
|
||||||
const originalTracks = [...tracks];
|
const originalTracks = [...tracks];
|
||||||
let currentTracks = [...tracks];
|
// Default sort: first available option (Playlist Order if no addedAt, else Date Added Newest)
|
||||||
currentSort = 'custom';
|
const hasAddedDate = tracks.some((t) => t.addedAt);
|
||||||
|
currentSort = hasAddedDate ? 'added-newest' : 'custom';
|
||||||
|
let currentTracks = sortTracks(originalTracks, currentSort);
|
||||||
|
|
||||||
const renderTracks = () => {
|
const renderTracks = () => {
|
||||||
// Re-fetch container each time because enableTrackReordering clones it
|
// Re-fetch container each time because enableTrackReordering clones it
|
||||||
|
|
|
||||||
|
|
@ -2202,6 +2202,7 @@ input:checked + .slider::before {
|
||||||
#context-menu li,
|
#context-menu li,
|
||||||
#sort-menu li {
|
#sort-menu li {
|
||||||
padding: 0.5rem 0.75rem;
|
padding: 0.5rem 0.75rem;
|
||||||
|
margin-right: 8px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
transition:
|
transition:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue