From e0bb15bf2d933816e0df6a27f5140cb05ef47af6 Mon Sep 17 00:00:00 2001 From: narcolepticinsomniac Date: Fri, 24 Aug 2018 20:18:27 -0400 Subject: [PATCH] Simplify reverse striping and correctly reconfigure upon style deletion --- popup/popup.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/popup/popup.js b/popup/popup.js index 8abd456a..45b0b5e0 100644 --- a/popup/popup.js +++ b/popup/popup.js @@ -285,8 +285,10 @@ function showStyles(styles) { }); var reverseZebra = $('.entry:last-child:nth-of-type(odd)'); - if (typeof(reverseZebra) !== 'undefined' && reverseZebra !== null) { + if (reverseZebra !== null) { $('#installed').classList.add('reverse-stripe'); + } else { + $('#installed').classList.remove('reverse-stripe'); } } @@ -537,7 +539,7 @@ function handleDelete(id) { } var reverseZebra = $('.entry:last-child:nth-of-type(odd)'); - if (typeof(reverseZebra) !== 'undefined' && reverseZebra !== null) { + if (reverseZebra !== null) { $('#installed').classList.add('reverse-stripe'); } else { $('#installed').classList.remove('reverse-stripe');