Skip to content

Instantly share code, notes, and snippets.

@ailabs-software
Created May 31, 2012 23:49
Show Gist options
  • Save ailabs-software/2847283 to your computer and use it in GitHub Desktop.
Save ailabs-software/2847283 to your computer and use it in GitHub Desktop.
Is this good code?
if ($(_parent).hasClass('item'))
{
$(_parent)[selected && $(this).closest('table').find('.item:not(.selected)').length == 0 ? 'addClass' : 'removeClass']('selected');
var _grandparent = $(_parent).parent().parent().parent().parent().parent().siblings();
if ($(_grandparent).hasClass('item')) $(_grandparent)[selected && $(_parent).closest('table').find('.item:not(.selected)').length == 0 ? 'addClass' : 'removeClass']('selected');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment