Orbit/app/assets/javascripts/attribute_form.js.erb

25 lines
670 B
Plaintext

$('.attributes_block a.delete').live('click', function(){
$(this).parents('.list_item').remove();
});
$('#attributes a.remove_existing_record').live('click', function(){
$(this).next('.should_destroy').attr('value', 1);
$("#attribute_" + $(this).prev().attr('value')).hide();
});
$('#attributes_block a.switch').live('click', function(){
$(this).parent().toggleClass('disable');
var $am = $(this).next('.built_in_state')
$am.attr('value', ($am.attr('value') == "false") ? "true" : "false");
});
$('.select_type select').live('change', function(){
if(this.value == 'select')
{
$(this).next().show();
}
else
{
$(this).next().hide();
}
});