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(){
|
let currentCategory = new (function(){
|
||||||
const currentPrimaryNode = null;
|
let currentPrimaryNode = null;
|
||||||
const currentSecondaryNode = null;
|
let currentSecondaryNode = null;
|
||||||
// TODO make filenames store ONLY the top level fileNames
|
// TODO make filenames store ONLY the top level fileNames
|
||||||
//
|
//
|
||||||
|
|
||||||
let currentTopLevelFileNames = null;
|
let currentTopLevelFileNames = null;
|
||||||
|
|
||||||
this.set = function(t,secondary){
|
this.set = function(t,secondary){
|
||||||
let targetNode;
|
|
||||||
if(secondary){
|
if(secondary){
|
||||||
targetNode = currentSecondaryNode;
|
currentSecondaryNode && currentSecondaryNode.classList.remove("currentCategory");
|
||||||
|
currentSecondaryNode = t;
|
||||||
|
currentSecondaryNode.classList.add("currentCategory");
|
||||||
}else{
|
}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){
|
if(!secondary){
|
||||||
currentTopLevelFileNames = DB.query(t.textContent);
|
currentTopLevelFileNames = DB.query(t.textContent);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue