From 80b68d27723efd8aebe9832e43dc0d91b4f58063 Mon Sep 17 00:00:00 2001 From: Mostly Void Date: Sun, 17 Oct 2021 20:18:07 +0530 Subject: [PATCH] Revert "Close links div when there is no links - #23" --- src/content.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/content.js b/src/content.js index 910ec25..e738059 100644 --- a/src/content.js +++ b/src/content.js @@ -5,10 +5,10 @@ browser.runtime.onMessage.addListener(() => { }); }); -const toggleSidebar = (length) => { +const toggleSidebar = () => { const hnmain = document.getElementById('hnmain'); const linksDiv = document.getElementsByClassName('linksDiv')[0]; - if (length === undefined || length === 0 || hnmain.align === 'left') { + if (hnmain.align === 'left') { linksDiv.style.display = 'none'; hnmain.width = '85%'; hnmain.align = 'center'; @@ -215,7 +215,7 @@ function createLinksArrayElement (linksArray) { const linksArray = createLinksArray(); createLinksArrayElement(linksArray); -toggleSidebar(linksArray.length); +toggleSidebar(); // Ellipsify the comment texts to three lines