luci-base: luci.js: fix sortedKeys() ordering
Chrome does not properly sort arrays when the sort function returns boolean
results, in contrast to Firefox which does.
Fix the issue by returning a numerical result instead.
Fixes: #4792
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 3c166c25de
)
This commit is contained in:
parent
2936a191f5
commit
1f74e21336
1 changed files with 6 additions and 1 deletions
|
@ -2946,7 +2946,12 @@
|
|||
}).filter(function(e) {
|
||||
return (e[1] != null);
|
||||
}).sort(function(a, b) {
|
||||
return (a[1] > b[1]);
|
||||
if (a[1] < b[1])
|
||||
return -1;
|
||||
else if (a[1] > b[1])
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}).map(function(e) {
|
||||
return e[0];
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue