Synchronize percentage for new progress bars

According to the HTML specification:

> The default value is the minimum plus half the difference between the
> minimum and the maximum, unless the maximum is less than the minimum,
> in which case the default value is the minimum.

So for new progress bars, we had a numeric value of `nil` and a range
value of `50`, meaning the input fields weren't in sync.

Manually triggering the event on the progress, while not an ideal
solution (ideally we would be able to define `0` as default), sets the
value of the numeric field.
This commit is contained in:
Javi Martín
2019-01-08 20:34:55 +01:00
committed by decabeza
parent fff5673ec0
commit 789476e6ab

View File

@@ -28,6 +28,8 @@ App.Forms =
input: ->
$("[name='#{this.name}']").val($(this).val())
$("[name='progress_bar[percentage]'][type='range']").trigger("input")
hideOrShowFieldsAfterSelection: ->
$("[name='progress_bar[kind]']").on
change: ->