We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d8e9e97 commit 06cc8aaCopy full SHA for 06cc8aa
coffee/react-countdown-clock.coffee
@@ -30,6 +30,10 @@ ReactCountdownClock = CreateReactClass
30
31
componentDidMount: ->
32
@_seconds = @props.seconds
33
+ if @props.maxSeconds > 0
34
+ @_percentOfMax = @_seconds / @props.maxSeconds
35
+ else
36
+ @_percentOfMax = 1
37
@_setupTimer()
38
39
componentWillUnmount: ->
@@ -166,7 +170,7 @@ ReactCountdownClock = CreateReactClass
166
170
@props.fontSize
167
171
168
172
_drawTimer: ->
169
- percent = @_fraction * @_seconds + 1.5
173
+ percent = @_fraction * @_seconds * @_percentOfMax + 1.5
174
formattedTime = @_formattedTime()
175
text = if (@props.paused && @props.pausedText?) then @props.pausedText else formattedTime
176
0 commit comments