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
1 changed files with 2 additions and 3 deletions

View File

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