Skip to content

Instantly share code, notes, and snippets.

@zodman
Created February 1, 2011 18:04
Show Gist options
  • Save zodman/806282 to your computer and use it in GitHub Desktop.
Save zodman/806282 to your computer and use it in GitHub Desktop.
jQuery(function($) {
$('div.inline-group').sortable({
items: 'tr.has_original',
handle: 'td',
update: function() {
$(this).find('tr.has_original').each(function(i) {
$(this).find('input[name$=sequence]').val(i+1);
$(this).removeClass('row1').removeClass('row2');
$(this).addClass('row'+((i%2)+1));
});
}
});
$('tr.has_original').css('cursor', 'move');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment