Summary Files Commits Branches @commit @diff @stats
path: root / src / scripts
diff options
context:
space:
mode:
1 files changed, 5 insertions, 2 deletions
-rw-r--r--src/scripts/page-width.js7
diff --git a/src/scripts/page-width.js b/src/scripts/page-width.js
index 353dc4d..4969c45 100644
--- a/src/scripts/page-width.js
+++ b/src/scripts/page-width.js
@@ -1,14 +1,17 @@
const widthBtn = document.getElementById('changeWidthBtn');
const widthLabel = widthBtn.childNodes[0];
const articleElem = document.getElementsByTagName('article')[0];
+const sidebarHeaderElem = document.getElementById('header');
if (localStorage.getItem('width') === 'wide') {
widthLabel.innerText = 'Narrow';
- articleElem.classList.add('article-wide');
+ articleElem.classList.add('wide');
+ sidebarHeaderElem.classList.toggle('wide');
}
widthBtn.onclick = function() {
- articleElem.classList.toggle('article-wide');
+ articleElem.classList.toggle('wide');
+ sidebarHeaderElem.classList.toggle('wide');
if (localStorage.getItem('width') !== 'norm') {
widthLabel.innerText = 'Wide';