summaryrefslogtreecommitdiffstats
path: root/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/codeblocks.js
blob: d8039c5d6f575f4443c2ae932a1d158363930b73 (plain)
1
2
3
4
5
6
7
8
9
10
let article = document.getElementById('prose')

if (article) {
  let codeBlocks = article.getElementsByTagName('code')
    for (let [key, codeBlock] of Object.entries(codeBlocks)){
    var widthDif = codeBlock.scrollWidth - codeBlock.clientWidth
    if (widthDif > 0)
      codeBlock.parentNode.classList.add('expand')
  }
}