1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00

BZ-1879167 Fixes copy button code block misalignment

This commit is contained in:
Lindsey Barbee-Vargas
2020-10-02 16:22:58 -04:00
committed by openshift-cherrypick-robot
parent c110faaee8
commit 1eb488bc44

View File

@@ -1,5 +1,5 @@
// This file runs the Clipboard.js functionality
document.querySelectorAll('div.listingblock').forEach((codeblock, index) => {
document.querySelectorAll('div.listingblock, div.literalblock').forEach((codeblock, index) => {
codeblock.getElementsByTagName('pre')[0].insertAdjacentHTML("beforebegin", "<p class='clipboard-button-container'><span class='clipboard-button fa fa-clipboard'></span></p>");
document.getElementsByTagName('pre')[index].setAttribute('id',`clipboard-${index}`);
});