Simplify hiding/showing progress bar type field

With a parent element for just input and label, there aren't conflicts
with the globalize tabs code anymore.
This commit is contained in:
Javi Martín
2019-01-08 20:28:09 +01:00
committed by decabeza
parent 96454a41f0
commit fff5673ec0
2 changed files with 6 additions and 6 deletions

View File

@@ -34,9 +34,9 @@ App.Forms =
title_field = $("[name^='progress_bar'][name$='[title]']").parent() title_field = $("[name^='progress_bar'][name$='[title]']").parent()
if this.value == "primary" if this.value == "primary"
title_field.addClass("hide") title_field.hide()
else else
title_field.removeClass("hide") title_field.show()
$("[name='progress_bar[kind]']").change() $("[name='progress_bar[kind]']").change()

View File

@@ -6,11 +6,11 @@
<%= f.enum_select :kind %> <%= f.enum_select :kind %>
</div> </div>
<div class="small-12 medium-6"> <%= f.translatable_fields do |translations_form| %>
<%= f.translatable_fields do |translations_form| %> <div class="small-12 medium-6">
<%= translations_form.text_field :title %> <%= translations_form.text_field :title %>
<% end %> </div>
</div> <% end %>
<% progress_options = { min: ProgressBar::RANGE.min, max: ProgressBar::RANGE.max, step: 1 } %> <% progress_options = { min: ProgressBar::RANGE.min, max: ProgressBar::RANGE.max, step: 1 } %>
<div class="small-12 medium-6 large-2"> <div class="small-12 medium-6 large-2">