fix text content of category names

This commit is contained in:
MrOtherGuy 2020-06-05 13:01:30 +03:00
parent fc5ef0f89a
commit 19a1359e70

View file

@ -98,12 +98,14 @@ function createCategories(){
const createNode = function(name,type){ const createNode = function(name,type){
let node = document.createElement("div"); let node = document.createElement("div");
node.classList.add(type); node.classList.add(type);
node.textContent = name.substring(0,name.lastIndexOf("."));
if(type === "target"){ if(type === "target"){
node.textContent = name.substring(0,name.lastIndexOf("."));
let link = node.appendChild(document.createElement("a")); let link = node.appendChild(document.createElement("a"));
node.classList.add("hidden"); node.classList.add("hidden");
link.href = `https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/${name}`; link.href = `https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/${name}`;
link.title = "See on Github"; link.title = "See on Github";
}else{
node.textContent = name;
} }
return node; return node;