diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-04-01 12:23:41 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-04-01 12:23:41 +0000 |
commit | cc515842fa3b005b5a7a4e9449b89fe0b30bc778 (patch) | |
tree | 7a8fee057f593e171213d1588b5f34becc9807df /misc/ajax.js | |
parent | fe26a907891969f1fe2ce7b30e2149920c9034b1 (diff) | |
download | brdo-cc515842fa3b005b5a7a4e9449b89fe0b30bc778.tar.gz brdo-cc515842fa3b005b5a7a4e9449b89fe0b30bc778.tar.bz2 |
- Patch #715528 by sun: optimize restripe() AJAX command.
Diffstat (limited to 'misc/ajax.js')
-rw-r--r-- | misc/ajax.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/misc/ajax.js b/misc/ajax.js index 23179fd07..f8e3ee6d3 100644 --- a/misc/ajax.js +++ b/misc/ajax.js @@ -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'); } }; |