Welcome to mirror list, hosted at ThFree Co, Russian Federation.

codeblocks.js « js « assets « gohugoioTheme « themes « docs - github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
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')
  }
}