Toggle media bin footer between Select all and Deselect all.
Clear multi-select in one click when any assets are selected. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
3d13053149
commit
8408a22bab
@@ -328,13 +328,14 @@
|
||||
|
||||
if (total > 0) {
|
||||
const footer = el("div", "media-bin-footer");
|
||||
const all = el("button", "btn ghost tiny", `Select all (${total})`);
|
||||
all.onclick = () => {
|
||||
mediaSelected.clear();
|
||||
bin.forEach((m) => mediaSelected.add(m.id));
|
||||
const hasSelection = selN > 0;
|
||||
const toggle = el("button", "btn ghost tiny", hasSelection ? `Deselect all (${selN})` : `Select all (${total})`);
|
||||
toggle.onclick = () => {
|
||||
if (hasSelection) mediaSelected.clear();
|
||||
else bin.forEach((m) => mediaSelected.add(m.id));
|
||||
render(S.get());
|
||||
};
|
||||
footer.append(all);
|
||||
footer.append(toggle);
|
||||
wrap.append(footer);
|
||||
}
|
||||
return wrap;
|
||||
|
||||
Reference in New Issue
Block a user