Author: jablko
Date: Wed Oct 13 22:56:11 2010
New Revision: 8107
Log:
Replace if statement with :not(:has()) selector
Modified:
trunk/js/multiDelete.js
Modified: trunk/js/multiDelete.js
==============================================================================
--- trunk/js/multiDelete.js Wed Oct 13 22:45:26 2010 (r8106)
+++ trunk/js/multiDelete.js Wed Oct 13 22:56:11 2010 (r8107)
@@ -14,23 +14,19 @@
// Hide element
var $parentRows = $(thisObj).closest('tr');
- // Add an "animateNicely" div to each td to make "hide" animation play
+ // Add "animateNicely" <div/> to each <td/> to make "hide" animation play
// nicely
- $('td', $parentRows).each(function ()
+ $('td:not(:has(.animateNicely))', $parentRows).each(function ()
{
- // Only add to rows that don't already have an animateNicely div
- if (0 == $('div.animateNicely', this).length)
+ if ('' == $.trim($(this).text()))
{
- if ('' == $.trim($(this).text()))
- {
- // Add a if <td> has no contents because hide() doesn't
- // seem to operate on <div>s that only contain whitespace
- $(this).html('<div class="animateNicely"> </div>');
- }
- else
- {
- $(this).wrapInner('<div class="animateNicely"></div>');
- }
+ // Add a if <td/> has no contents because .hide() doesn't
+ // seem to operate on <div/>s that contain only whitespace
+ $(this).html('<div class="animateNicely"> </div>');
+ }
+ else
+ {
+ $(this).wrapInner('<div class="animateNicely"></div>');
}
});
--
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/qubit-commits?hl=en.