There is a lot of duplication in the settings page template. Let's make it simpler.
The first two commits are slightly unrelated: one fixes incorrect button label in Notifications section, the second correctly selects option based on custom field type (the attribute seems to be field_type, not type_).
The following commits perform these changes:
Make sure that there always is at least one row in each extensible form (priorities, milestones, close statuses, custom fields, quick replies). This is only use visible change.
Remove HTML from JS snippets. Instead we can clone last from respective form (since we are sure there is at least one), reset value in all input fields and append it to the form. Setting default priorities can be simplified by cloning rows as well.
All the snippets now only differ in identifier of the form. Moving this information to a data- attribute on the button we can use a single snippet for all the forms.
There is a lot of duplication in the settings page template. Let's make it simpler.
The first two commits are slightly unrelated: one fixes incorrect button label in Notifications section, the second correctly selects option based on custom field type (the attribute seems to be
field_type, nottype_).The following commits perform these changes:
data-attribute on the button we can use a single snippet for all the forms.