mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
l2: show which column sorts and in which direction
Clicking a heading sorted the table but nothing said so afterwards - the only feedback was the rows moving, which is no help when the sort key is a column you are not looking at. Give every sortable heading a permanent marker: a neutral double arrow when it is not the sort key, up or down when it is. The marker sits in its own span so the i18n pass, which replaces the heading text, does not wipe it.
This commit is contained in:
@@ -100,6 +100,10 @@ function renderL2() {
|
||||
var x = l2Key(a, l2SortCol), y = l2Key(b, l2SortCol);
|
||||
return (x < y ? -1 : x > y ? 1 : 0) * l2SortDir;
|
||||
});
|
||||
['port', 'mac', 'vlan', 'type'].forEach(function(c) {
|
||||
var a = document.getElementById('l2a_' + c);
|
||||
if (a) a.textContent = (c === l2SortCol) ? (l2SortDir > 0 ? ' \u25b2' : ' \u25bc') : ' \u21c5';
|
||||
});
|
||||
paintL2(tbl, rows);
|
||||
var cnt = document.getElementById('l2count');
|
||||
if (cnt) cnt.textContent = rows.length + ' / ' + l2All.length;
|
||||
|
||||
Reference in New Issue
Block a user