From a6f8798525b666e9befc59b57251f051976d0d19 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 11 Jul 2023 17:04:59 +0300 Subject: [scripts] Replaced innerHTML with innerText due to CSP --- src/scripts/page-width.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/scripts/page-width.js') diff --git a/src/scripts/page-width.js b/src/scripts/page-width.js index 6d700d0..c77912c 100644 --- a/src/scripts/page-width.js +++ b/src/scripts/page-width.js @@ -2,7 +2,7 @@ const widthBtn = document.getElementById('changeWidthBtn'); const articleElem = document.getElementsByTagName('article')[0]; if (localStorage.getItem('width') === 'wide') { - widthBtn.innerHTML = 'Narrow
article'; + widthBtn.innerText = 'Narrow\narticle'; articleElem.classList.add('noMaxWidth'); } @@ -10,11 +10,11 @@ widthBtn.onclick = function() { articleElem.classList.toggle('noMaxWidth'); if (localStorage.getItem('width') !== 'norm') { - widthBtn.innerHTML = 'Wide
article'; + widthBtn.innerText = 'Wide\narticle'; localStorage.setItem('width', 'norm'); } else { - widthBtn.innerHTML = 'Narrow
article'; + widthBtn.innerText = 'Narrow\narticle'; localStorage.setItem('width', 'wide'); } } -- cgit v1.3.1-23-gd82d