mirror of
https://github.com/thegeeklab/hugo-geekdoc.git
synced 2024-06-04 09:29:43 +02:00
Robert Kaussow
75f56d8fad
BREAKING CHANGE: The `--code-max-height` formatting is applied only to code blocks that use syntax highlighting, see [documentation](https://geekdocs.de/features/code-blocks/).
22 lines
733 B
JavaScript
22 lines
733 B
JavaScript
document.addEventListener("DOMContentLoaded", function (event) {
|
|
var clipboard = new ClipboardJS(".clip");
|
|
|
|
clipboard.on("success", function (e) {
|
|
const trigger = e.trigger;
|
|
|
|
if (trigger.hasAttribute("data-copy-feedback")) {
|
|
trigger.classList.add("gdoc-post__codecopy--success");
|
|
trigger.querySelector(".icon.copy").classList.add("hidden");
|
|
trigger.querySelector(".icon.check").classList.remove("hidden");
|
|
|
|
setTimeout(function () {
|
|
trigger.classList.remove("gdoc-post__codecopy--success");
|
|
trigger.querySelector(".icon.copy").classList.remove("hidden");
|
|
trigger.querySelector(".icon.check").classList.add("hidden");
|
|
}, 3000);
|
|
}
|
|
|
|
e.clearSelection();
|
|
});
|
|
});
|