Simplify reverse striping and correctly reconfigure upon style deletion

This commit is contained in:
narcolepticinsomniac 2018-08-24 20:18:27 -04:00 committed by GitHub
parent 256bcdcaed
commit e0bb15bf2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -285,8 +285,10 @@ function showStyles(styles) {
}); });
var reverseZebra = $('.entry:last-child:nth-of-type(odd)'); var reverseZebra = $('.entry:last-child:nth-of-type(odd)');
if (typeof(reverseZebra) !== 'undefined' && reverseZebra !== null) { if (reverseZebra !== null) {
$('#installed').classList.add('reverse-stripe'); $('#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)'); var reverseZebra = $('.entry:last-child:nth-of-type(odd)');
if (typeof(reverseZebra) !== 'undefined' && reverseZebra !== null) { if (reverseZebra !== null) {
$('#installed').classList.add('reverse-stripe'); $('#installed').classList.add('reverse-stripe');
} else { } else {
$('#installed').classList.remove('reverse-stripe'); $('#installed').classList.remove('reverse-stripe');