mirror of https://github.com/onweru/compose.git

weru
30.04.2020 dfad1ec43b34f84ddcee2b94ea2641fe0d798a6c
assets/js/index.js
@@ -136,15 +136,17 @@
      tocs.forEach(function(toc){
        toc.id = "";
        pushClass(toc, 'toc');
        const tocItems = Array.from(toc.children[0].children);
        const previousHeading = toc.previousElementSibling;
        previousHeading.matches('.active') ? pushClass(toc, tocActive) : false;
        if(toc.children.length >= 1) {
          const tocItems = Array.from(toc.children[0].children);
  
        tocItems.forEach(function(item){
          pushClass(item, 'toc_item');
          pushClass(item.firstElementChild, 'toc_link');
        })
          const previousHeading = toc.previousElementSibling;
          previousHeading.matches('.active') ? pushClass(toc, tocActive) : false;
          tocItems.forEach(function(item){
            pushClass(item, 'toc_item');
            pushClass(item.firstElementChild, 'toc_link');
          })
        }
      });
      const currentToc = elem(`.${tocActive}`);