list.unlist.js: Use jQuery's toggleClass instead of native if-else (just for briefness)
This commit is contained in:
parent
a87ced2646
commit
c1ac95e440
1 changed files with 2 additions and 3 deletions
|
@ -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);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue