orbit-basic/app/assets/javascripts/attribute_form.js.erb

25 lines
656 B
Plaintext
Raw Normal View History

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