1
0

Added Quantity.primary to form

Fixed setting parent on Quantity form
This commit is contained in:
cryptogopher
2019-10-26 21:48:52 +02:00
parent 7b46f131c0
commit 26f653819d
3 changed files with 7 additions and 1 deletions

View File

@@ -10,13 +10,17 @@
<% end %>
<p><%= f.text_field :name, size: 25, required: true %></p>
<p><%= f.text_field :description, size: 200 %></p>
<p><%= f.check_box :primary %></p>
</div>
<%= javascript_tag do %>
function domainChange() {
$('[id^=parent_select_]').prop('disabled', true).hide();
$('[id^=parent_select_] select').attr('name', 'placeholder');
$('[id=parent_select_'+$('#quantity_domain option:selected').val()+']')
.prop('disabled', false).show();
$('[id=parent_select_'+$('#quantity_domain option:selected').val()+'] select')
.attr('name', 'quantity[parent_id]');
}
$('#quantity-form').on('click', '#quantity_domain', domainChange);