projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
99e9c10
)
luci-base: luci.js: fix sortedKeys() ordering
author
Jo-Philipp Wich
<jo@mein.io>
Tue, 9 Feb 2021 23:02:59 +0000
(
00:02
+0100)
committer
Jo-Philipp Wich
<jo@mein.io>
Tue, 9 Feb 2021 23:07:32 +0000
(
00:07
+0100)
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>
modules/luci-base/htdocs/luci-static/resources/luci.js
patch
|
blob
|
history
diff --git
a/modules/luci-base/htdocs/luci-static/resources/luci.js
b/modules/luci-base/htdocs/luci-static/resources/luci.js
index 936630a79d312a79fd50d48465f1355893129816..23853e2cc89eb3363c0ff6b8163a5a08944722c9 100644
(file)
--- a/
modules/luci-base/htdocs/luci-static/resources/luci.js
+++ b/
modules/luci-base/htdocs/luci-static/resources/luci.js
@@
-2972,7
+2972,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];
});