summaryrefslogtreecommitdiffstats
path: root/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/codeblocks.js
diff options
context:
space:
mode:
Diffstat (limited to 'docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/codeblocks.js')
-rw-r--r--docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/codeblocks.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/codeblocks.js b/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/codeblocks.js
new file mode 100644
index 000000000..d8039c5d6
--- /dev/null
+++ b/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/codeblocks.js
@@ -0,0 +1,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')
+ }
+}