From 38e3c0dd798f8bfe59f9cdfb1f24693ae907ded0 Mon Sep 17 00:00:00 2001 From: Martin Mahner Date: Sat, 24 Mar 2018 09:26:27 +0100 Subject: [PATCH] Fixed wordwrap for multiple items in History --- client/js/dpaste.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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')); } }