function addCol() {
var ul = document.createElement("ul");
- ul.setAttribute("id", "new-category");
+ ul.setAttribute("id", "new");
ul.setAttribute('draggable', 'true');
ul.addEventListener('dragstart', dragStart, false);
ul.addEventListener('dragenter', dragEnter, false);
ul.appendChild(title);
var p = document.createElement("p");
- p.innerText = "new-category";
+ p.innerText = "new";
title.appendChild(p);
- title.insertAdjacentHTML("beforeend", "<span class='add' id='add-new-category'>+</span>");
+ title.insertAdjacentHTML("beforeend", "<span class='add' id='add-new'>+</span>");
rmbutton = document.createElement("span");
rmbutton.setAttribute("class", "rmcol");
- rmbutton.setAttribute("id", "rmcol-new-category");
+ rmbutton.setAttribute("id", "rmcol-new");
rmbutton.innerText = "-";
rmbutton.addEventListener('click', function(event){
console.log("Deleting column " + this.parentNode.parentNode);
title.getElementsByClassName("add")[0].style.display = "flex";
title.getElementsByTagName("p")[0].style.width = "calc(100% - 90px)";
- listen(title.getElementsByClassName("add")[0]);
+ mainlist.push(["new"]);
save();
+ listen(title.getElementsByClassName("add")[0]);
}
function listen(li) {
newli.insertAdjacentHTML("beforeend", "<a href="+siteurl+">"+nme+"</a>");
newli.insertAdjacentHTML("beforeend", rmspan[0]+columnToArray(ul).length.toString()+"-"+caller[1]+rmspan[1]);
- document.getElementById(caller[1]).appendChild(newli);
+ document.getElementById(id).appendChild(newli);
save();
listen(newli);
}