Home › Forums › Other › Testing Markdown › Reply To: Testing Markdown
August 5, 2014 at 10:35 am
#177735
Justin Sainton
Participant
`
ajax_callback = function(response) {
var checklist, color, set_id, existing_set, content;
if (response.is_successful) {
checklist = $(‘.variation_checkboxes’);
content = $(response.obj.content);
set_id = content.attr(‘id’);
existing_set = checklist.find(‘#’ + set_id);
if (existing_set.size() > 0) {
existing_set.find(‘.children’).append(content.find(‘.children .ajax’));
} else {
checklist.append(content);
}
color = checklist.find('li').css('backgroundColor') || '#FFFFFF';
checklist.find('.ajax').
animate({ backgroundColor: '#FFFF33' }, 'fast').
animate({ backgroundColor: color }, 'fast', function(){
$(this).css('backgroundColor', 'transparent');
}).
removeClass('ajax');
} else {
alert(response.error.messages.join("\n"));
}
form.hide().find('input:text').val('');
form.find('label').show().css('opacity', '1');
spinner.toggleClass('ajax-feedback-active');
};
`