This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/app/assets/javascripts/attribute_form.js.erb

25 lines
656 B
Plaintext

$('.attributes_block a.delete').live('click', function(){
$(this).parents('.list_item').remove();
});
$('.action a.remove_existing_record').live('click', function(){
$(this).next('.should_destroy').attr('value', 1);
$("#attribute_" + $(this).prev().attr('value')).hide();
});
$('.action 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();
}
});