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

Blake Gearin
04.22.2022 13b85c7c54e5659caf359ec536708bb80e032e86
Fix forEach error on empty variable
1 files modified
20 ■■■■■ changed files
assets/js/index.js 20 ●●●●● patch | view | raw | blame | history
assets/js/index.js
@@ -109,7 +109,7 @@
          tocItems.forEach(function(item){
            pushClass(item, 'toc_item');
            pushClass(item.firstElementChild, 'toc_link');
          })
          });
        }
      });
@@ -143,12 +143,14 @@
    }
    const paragraphs = elems('p');
    paragraphs.forEach(function(p){
      const buttons = elems('.button', p);
      if(buttons.length > 1) {
        pushClass(p, 'button_grid');
      }
    });
    if (paragraphs) {
      paragraphs.forEach(function(p){
        const buttons = elems('.button', p);
        if(buttons.length > 1) {
          pushClass(p, 'button_grid');
        }
      });
    }
  })();
  (function markExternalLinks(){
@@ -216,7 +218,7 @@
    copyText.innerText = 'Link Copied';
    if(!elem(`.${yanked}`, parent)) {
      parent.appendChild(copyText);
      setTimeout(function() {
      setTimeout(function() {
        parent.removeChild(copyText)
      }, 2250);
    }
@@ -378,7 +380,7 @@
      } else {
        deleteClass(toTop, active);
      }
    })
    });
  })();
}