Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Little fix for nested forms #2490

Merged
merged 2 commits into from
Nov 27, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,8 @@ $(document).on 'nested:fieldRemoved', 'form', (content) ->
add_button = toggler.next()
add_button.addClass('add_nested_fields').html(add_button.data('add-label'))

# Removing all reuired attributes from deleted child form to bypass browser validations.
field.find('[required]').each ->
#console.log $(this).attr('name')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is useless

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean commented console.log line?

$(this).removeAttr('required')
return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to explicitly return here, could you remove it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just used javascript to coffeescript online converter. I wanted to convert to coffee this:

  field.find('required').each(function() {
        $(this).removeAttr('required')
  });

It returned me that kind of code. It is redundant?