diff --git a/client/js/dpaste.js b/client/js/dpaste.js index cbb18a0..a59ca09 100644 --- a/client/js/dpaste.js +++ b/client/js/dpaste.js @@ -37,13 +37,13 @@ document.body.onkeydown = function(e) { // Toggle Wordwrap // ----------------------------------------------------------------------------- const wordwrapCheckbox = document.getElementById('wordwrap'); -const snippetDiv = document.querySelector('.snippet-code'); +const snippetDiv = document.querySelectorAll('.snippet-code'); function toggleWordwrap() { if (wordwrapCheckbox.checked) { - snippetDiv.classList.add('wordwrap'); + snippetDiv.forEach(i => i.classList.add('wordwrap')); } else { - snippetDiv.classList.remove('wordwrap'); + snippetDiv.forEach(i => i.classList.remove('wordwrap')); } }