properly store current primary and secondary nodes
This commit is contained in:
parent
0b56963e78
commit
f9b151ccfd
1 changed files with 8 additions and 8 deletions
|
@ -46,23 +46,23 @@ function fetchWithType(url){
|
|||
}
|
||||
|
||||
let currentCategory = new (function(){
|
||||
const currentPrimaryNode = null;
|
||||
const currentSecondaryNode = null;
|
||||
let currentPrimaryNode = null;
|
||||
let currentSecondaryNode = null;
|
||||
// TODO make filenames store ONLY the top level fileNames
|
||||
//
|
||||
|
||||
let currentTopLevelFileNames = null;
|
||||
|
||||
this.set = function(t,secondary){
|
||||
let targetNode;
|
||||
if(secondary){
|
||||
targetNode = currentSecondaryNode;
|
||||
currentSecondaryNode && currentSecondaryNode.classList.remove("currentCategory");
|
||||
currentSecondaryNode = t;
|
||||
currentSecondaryNode.classList.add("currentCategory");
|
||||
}else{
|
||||
targetNode = currentPrimaryNode;
|
||||
currentPrimaryNode && currentPrimaryNode.classList.remove("currentCategory");
|
||||
currentPrimaryNode = t;
|
||||
currentPrimaryNode.classList.add("currentCategory");
|
||||
}
|
||||
targetNode && targetNode.classList.remove("currentCategory");
|
||||
targetNode = t;
|
||||
targetNode.classList.add("currentCategory");
|
||||
if(!secondary){
|
||||
currentTopLevelFileNames = DB.query(t.textContent);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue