pidgin/nest

Merged in default (pull request #43)

2019-08-22, Gary Kramlich
cd63b87c08cc
Merged in default (pull request #43)

Don't add Copy-to-Clipboard to the Table of Contents.

Approved-by: Gary Kramlich
--- a/hugo/themes/learn/static/js/learn.js Tue Aug 20 03:24:59 2019 -0400
+++ b/hugo/themes/learn/static/js/learn.js Thu Aug 22 04:05:48 2019 +0000
@@ -195,9 +195,10 @@
elems.each(function () {
const code = $(this);
const isInHeading = code.parent().is('h1,h2,h3,h4,h5,h6,h7');
+ const isInToc = code.parents('nav#TableOfContents').length > 0;
const isTooShort = code.text().length < 5
- if (!isInHeading && !isTooShort) {
+ if (!isInHeading && !isInToc && !isTooShort) {
code.after('<span class="copy-to-clipboard" title="Copy to clipboard" />');
code.next('.copy-to-clipboard').on('mouseleave', removeTooltip);
}