Hide title field for primary progress bars

These bars don't have a title.
This commit is contained in:
Javi Martín
2019-01-04 16:26:35 +01:00
committed by decabeza
parent c5d32c5ab9
commit dfdf0b0636
2 changed files with 18 additions and 0 deletions

View File

@@ -28,9 +28,22 @@ App.Forms =
input: ->
$("[name='#{this.name}']").val($(this).val())
hideOrShowFieldsAfterSelection: ->
$("[name='progress_bar[kind]']").on
change: ->
title_field = $("[name^='progress_bar'][name$='[title]']").parent()
if this.value == "primary"
title_field.addClass("hide")
else
title_field.removeClass("hide")
$("[name='progress_bar[kind]']").change()
initialize: ->
App.Forms.disableEnter()
App.Forms.submitOnChange()
App.Forms.toggleLink()
App.Forms.synchronizeInputs()
App.Forms.hideOrShowFieldsAfterSelection()
false