Fixed wordwrap for multiple items in History

This commit is contained in:
Martin Mahner 2018-03-24 09:26:27 +01:00
parent 6fa4e6d7a6
commit 38e3c0dd79

View file

@ -37,13 +37,13 @@ document.body.onkeydown = function(e) {
// Toggle Wordwrap // Toggle Wordwrap
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
const wordwrapCheckbox = document.getElementById('wordwrap'); const wordwrapCheckbox = document.getElementById('wordwrap');
const snippetDiv = document.querySelector('.snippet-code'); const snippetDiv = document.querySelectorAll('.snippet-code');
function toggleWordwrap() { function toggleWordwrap() {
if (wordwrapCheckbox.checked) { if (wordwrapCheckbox.checked) {
snippetDiv.classList.add('wordwrap'); snippetDiv.forEach(i => i.classList.add('wordwrap'));
} else { } else {
snippetDiv.classList.remove('wordwrap'); snippetDiv.forEach(i => i.classList.remove('wordwrap'));
} }
} }