test alphabetical sorting again
This commit is contained in:
parent
11fcf00269
commit
1e56cd34ad
2 changed files with 7 additions and 4 deletions
|
@ -15,6 +15,7 @@ a:visited{ color: rgb(150,100,200) }
|
|||
a:hover{ color: rgb(200,150,100) }
|
||||
pre:empty{ display: none }
|
||||
.category{ padding: 0.2em 1em; cursor: pointer }
|
||||
.category::after{ content: " (" attr(data-value) ")"}
|
||||
|
||||
.currentCategory,
|
||||
.category:hover{ background-color: grey }
|
||||
|
|
|
@ -106,7 +106,8 @@ function createCategories(){
|
|||
link.title = "See on Github";
|
||||
link.target = "_blank";
|
||||
}else{
|
||||
node.textContent = name;
|
||||
node.textContent = name.name;
|
||||
node.setAttribute("data-value",name.value);
|
||||
}
|
||||
|
||||
return node;
|
||||
|
@ -140,12 +141,13 @@ function createCategories(){
|
|||
}
|
||||
}
|
||||
let map = ret.map((a,i)=>({name:a,value:ns[i]}))
|
||||
|
||||
return map.sort((a,b)=>(a.value > b.value?-1:a.value < b.value ? 1:0))
|
||||
return map
|
||||
//return map.sort((a,b)=>(a.value > b.value?-1:a.value < b.value ? 1:0))
|
||||
})();
|
||||
|
||||
for(let cat of CAT_NAMES){
|
||||
CAT_PARENT.appendChild(createCategory(cat.name))
|
||||
// CAT_PARENT.appendChild(createCategory(cat.name))
|
||||
CAT_PARENT.appendChild(createNode(cat,"category"))
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue