Skip to content

Commit 60d5ca1

Browse files
watch markCopiers to grab content to clipboard
1 parent f57f94f commit 60d5ca1

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/scripts.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ const fieldsets = document.querySelectorAll('fieldset');
2727
// all found toggles
2828
const toggles = document.querySelectorAll('#mark-your-work footer input');
2929

30+
// all found copiers
31+
const copiers = document.querySelectorAll('#mark-your-work footer button');
32+
3033
// empty defaults obj
3134
let applyDefaults = {};
3235

@@ -582,6 +585,19 @@ function watchMarkToggles(toggles, state) {
582585
});
583586
}
584587

588+
function watchMarkCopiers(copiers, state) {
589+
590+
copiers.forEach((element, index) => {
591+
592+
element.addEventListener("click", (event) => {
593+
console.log('copying is happening');
594+
595+
//perform copy
596+
});
597+
598+
});
599+
}
600+
585601

586602

587603

@@ -604,6 +620,7 @@ document.addEventListener("DOMContentLoaded", (event) => {
604620
watchFieldsets(fieldsets, state);
605621
watchAttributionDetails(fieldsets, state);
606622
watchMarkToggles(toggles, state);
623+
watchMarkCopiers(copiers, state);
607624

608625
console.log("DOM fully loaded and parsed");
609626
});

0 commit comments

Comments
 (0)