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
670 B
Plaintext
Raw Normal View History

$('.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();
}
});