restaure the commentary section
& put sorting button after download button
This commit is contained in:
parent
7a6699b329
commit
83de989b9c
1 changed files with 27 additions and 13 deletions
36
js/ui.js
36
js/ui.js
|
|
@ -2974,22 +2974,36 @@ export class UIRenderer {
|
||||||
const likeBtn = actionsDiv.querySelector('#like-playlist-btn');
|
const likeBtn = actionsDiv.querySelector('#like-playlist-btn');
|
||||||
|
|
||||||
if (dlBtn) {
|
if (dlBtn) {
|
||||||
// Insert Shuffle before Download
|
// We want Shuffle first, then Edit/Delete/Share.
|
||||||
actionsDiv.insertBefore(shuffleBtn, dlBtn);
|
// But Download is usually first or second.
|
||||||
|
// In renderPlaylistPage: Play, Download, Like.
|
||||||
|
// We want Shuffle after Play? Or after Download?
|
||||||
|
// Previous code: actionsDiv.insertBefore(shuffleBtn, dlBtn); => Shuffle before Download.
|
||||||
|
// Then appended others.
|
||||||
|
|
||||||
|
// Let's just append everything for now to keep it simple, or insert Shuffle specifically.
|
||||||
|
// The Play button is static. Download is static.
|
||||||
|
|
||||||
|
// If we want Shuffle before Download:
|
||||||
|
// fragment has Shuffle, Edit, Delete, Share.
|
||||||
|
// If we insert fragment before Download, all go before Download.
|
||||||
|
// That might change the order.
|
||||||
|
// Previous order: Shuffle (before Download), then Edit/Delete/Share (appended = after Like).
|
||||||
|
|
||||||
|
// Let's split fragment?
|
||||||
|
// Or just use append for all.
|
||||||
|
// The user didn't complain about order, but consistency is good.
|
||||||
|
// "Fix popup buttons" was the request.
|
||||||
|
|
||||||
|
// Let's stick to appending for now to minimize visual layout shifts from previous (where Edit/Delete were appended).
|
||||||
|
// Shuffle was inserted before Download.
|
||||||
|
actionsDiv.insertBefore(shuffleBtn, dlBtn);
|
||||||
// Insert Sort after Download, before Like
|
// Insert Sort after Download, before Like
|
||||||
if (sortBtn) {
|
if (sortBtn && likeBtn) {
|
||||||
if (likeBtn) {
|
|
||||||
actionsDiv.insertBefore(sortBtn, likeBtn);
|
actionsDiv.insertBefore(sortBtn, likeBtn);
|
||||||
} else {
|
} else if (sortBtn) {
|
||||||
// If no Like button, insert Sort after Download
|
|
||||||
if (dlBtn.nextSibling) {
|
|
||||||
actionsDiv.insertBefore(sortBtn, dlBtn.nextSibling);
|
|
||||||
} else {
|
|
||||||
actionsDiv.appendChild(sortBtn);
|
actionsDiv.appendChild(sortBtn);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Append Edit/Delete/Share buttons after Like
|
// Append Edit/Delete/Share buttons after Like
|
||||||
while (fragment.firstChild) {
|
while (fragment.firstChild) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue