Refactor to copy button script
This commit is contained in:
parent
0847809834
commit
7fe413d720
@ -1,10 +1,10 @@
|
||||
import clickableMaker from "./clickable-maker";
|
||||
import codeBlockFormatter from "./code-block-formatter";
|
||||
import copyButton from "./copy-button";
|
||||
import tabbed from "./tabbed";
|
||||
import _ from "./lunr";
|
||||
|
||||
window.addEventListener('load', () => {
|
||||
clickableMaker();
|
||||
codeBlockFormatter();
|
||||
copyButton();
|
||||
tabbed();
|
||||
});
|
||||
|
||||
@ -2,6 +2,7 @@ export default function() {
|
||||
Array.from(document.querySelectorAll('[data-copy-button=true]')).forEach(e => {
|
||||
const copyButton = document.createElement('button');
|
||||
copyButton.classList.add('copy-button');
|
||||
copyButton.title = "Click to copy";
|
||||
|
||||
copyButton.addEventListener('click', () => {
|
||||
const addTemporaryClass = (className, time) => {
|
||||
Loading…
Reference in New Issue
Block a user