fix: no arrow on the sorted column
This commit is contained in:
1 parent
c911143eb2
commit
19f8b5291e
1 file changed
+2
-10
@@ -48,7 +48,6 @@
|
|||||||
/* Sortable headers: a click sorts by the column, a second one turns it round. */
|
/* Sortable headers: a click sorts by the column, a second one turns it round. */
|
||||||
table.fm th.srt { cursor:pointer; user-select:none; white-space:nowrap; }
|
table.fm th.srt { cursor:pointer; user-select:none; white-space:nowrap; }
|
||||||
table.fm th.srt:hover { color:var(--text); }
|
table.fm th.srt:hover { color:var(--text); }
|
||||||
table.fm th.srt i { font-style:normal; display:inline-block; width:12px; margin-left:4px; color:var(--accent); font-size:10px; }
|
|
||||||
table.fm .c-sz { width:120px; }
|
table.fm .c-sz { width:120px; }
|
||||||
table.fm .c-mt { width:160px; }
|
table.fm .c-mt { width:160px; }
|
||||||
table.fm .c-act { width:160px; }
|
table.fm .c-act { width:160px; }
|
||||||
@@ -212,8 +211,8 @@
|
|||||||
<table class="fm">
|
<table class="fm">
|
||||||
<thead><tr>
|
<thead><tr>
|
||||||
<th style="width:28px"><input type="checkbox" id="all"></th>
|
<th style="width:28px"><input type="checkbox" id="all"></th>
|
||||||
<th class="srt" data-sort="name">Имя<i></i></th><th class="sz c-sz srt" data-sort="size">Размер<i></i></th>
|
<th class="srt" data-sort="name">Имя</th><th class="sz c-sz srt" data-sort="size">Размер</th>
|
||||||
<th class="sz c-mt srt" data-sort="mtime">Изменён<i></i></th><th class="c-act"></th>
|
<th class="sz c-mt srt" data-sort="mtime">Изменён</th><th class="c-act"></th>
|
||||||
</tr></thead>
|
</tr></thead>
|
||||||
<tbody id="list"></tbody>
|
<tbody id="list"></tbody>
|
||||||
</table>
|
</table>
|
||||||
@@ -354,12 +353,6 @@
|
|||||||
return (d || byName(a, b)) * s.dir;
|
return (d || byName(a, b)) * s.dir;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function showSort() {
|
|
||||||
const s = getSort();
|
|
||||||
document.querySelectorAll('table.fm th.srt').forEach(th => {
|
|
||||||
th.querySelector('i').textContent = th.dataset.sort === s.by ? (s.dir > 0 ? '▲' : '▼') : '';
|
|
||||||
});
|
|
||||||
}
|
|
||||||
document.querySelectorAll('table.fm th.srt').forEach(th => th.onclick = () => {
|
document.querySelectorAll('table.fm th.srt').forEach(th => th.onclick = () => {
|
||||||
const s = getSort(), by = th.dataset.sort;
|
const s = getSort(), by = th.dataset.sort;
|
||||||
// A new column starts the way it is most often wanted: names A to Z,
|
// A new column starts the way it is most often wanted: names A to Z,
|
||||||
@@ -369,7 +362,6 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
function render() {
|
function render() {
|
||||||
showSort();
|
|
||||||
const tb = $('list'); tb.innerHTML = '';
|
const tb = $('list'); tb.innerHTML = '';
|
||||||
updateSel();
|
updateSel();
|
||||||
for (const e of sorted()) {
|
for (const e of sorted()) {
|
||||||
|
|||||||
Reference in new issue
Block a user