From b946b6d7501c599c6a661aab408f0227b22101a7 Mon Sep 17 00:00:00 2001 From: src48597962 <48597962@qq.com> Date: Sat, 18 Feb 2023 16:48:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'SrcJyAlist.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SrcJyAlist.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/SrcJyAlist.js b/SrcJyAlist.js index 32e0adc2..212c797c 100644 --- a/SrcJyAlist.js +++ b/SrcJyAlist.js @@ -92,7 +92,16 @@ function getlist(data,isdir) { let newList = []; newList = newList.concat(cn_list.sort((a, b) => a.name.localeCompare(b.name))); newList = newList.concat(en_list.sort((a, b) => a.name.localeCompare(b.name))); - newList = newList.concat(num_list.sort((a, b) => a.name - b.name)); + newList = newList.concat(num_list.sort((a, b) => { + if (parseInt(a.name) < parseInt(b.name)) { + return -1; + } else if (parseInt(a.name) == parseInt(b.name)) { + return 0; + } else { + return 1; + } + } + )); newList = newList.concat(symbol_list.sort((a, b) => a.name - b.name)); return newList; }