- Patch #715528 by sun: optimize restripe() AJAX command.

merge-requests/26/head
Dries Buytaert 2010-04-01 12:23:41 +00:00
parent fe26a90789
commit cc515842fa
1 changed files with 5 additions and 6 deletions

View File

@ -423,12 +423,11 @@ Drupal.ajax.prototype.commands = {
restripe: function (ajax, response, status) {
// :even and :odd are reversed because jQuery counts from 0 and
// we count from 1, so we're out of sync.
$('tbody tr:not(:hidden)', $(response.selector))
.removeClass('even').removeClass('odd')
.filter(':even')
.addClass('odd').end()
.filter(':odd')
.addClass('even');
// Match immediate children of the parent element to allow nesting.
$('> tbody > tr:visible, > tr:visible', $(response.selector))
.removeClass('odd even')
.filter(':even').addClass('odd').end()
.filter(':odd').addClass('even');
}
};