list.unlist.js: Use jQuery's toggleClass instead of native if-else (just for briefness)

This commit is contained in:
Julius 2013-09-25 20:58:53 +02:00
parent a87ced2646
commit c1ac95e440

View file

@ -161,9 +161,8 @@ List.prototype.templateEngines.unlist = function(list, settings) {
var headSel = '.' + settings.listHeadingsClass; var headSel = '.' + settings.listHeadingsClass;
$(headSel, listSource).each(function() { $(headSel, listSource).each(function() {
if( $(this).nextUntil(headSel, ':not(.unlisted)').length ) { var listedCount = $(this).nextUntil(headSel, ':not(.unlisted)').length;
$(this).removeClass('unlisted'); $(this).toggleClass('unlisted', 0==listedCount);
}
}); });
}; };