From 3a5891fdfebecd20c9e26830c786fccdd13dcd8e Mon Sep 17 00:00:00 2001 From: MrOtherGuy Date: Fri, 5 Jun 2020 09:37:49 +0300 Subject: [PATCH] sort legacy as last category --- html_resources/selector.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html_resources/selector.js b/html_resources/selector.js index 6370a3b..424d0a4 100644 --- a/html_resources/selector.js +++ b/html_resources/selector.js @@ -133,12 +133,12 @@ function createCategories(){ ret[++i]=item; ns[i]=0; }else{ - ns[i]++ + ns[i] += (item === "legacy") ? 0 : 1; } } let map = ret.map((a,i)=>({name:a,value:ns[i]})) - return map.sort((a,b)=>(a.name==="legacy"?2:a.value > b.value?-1:a.value < b.value ? 1:0)) + return map.sort((a,b)=>(:a.value > b.value?-1:a.value < b.value ? 1:0)) })(); for(let cat of CAT_NAMES){