Debounce limit concurrent builds input in settings
This commit is contained in:
parent
5ad61f1968
commit
c0f2416703
|
@ -11,7 +11,16 @@ LimitConcurrentBuildsComponent = Ember.Component.extend
|
||||||
description
|
description
|
||||||
).property('enabled')
|
).property('enabled')
|
||||||
|
|
||||||
|
limitChanged: ->
|
||||||
|
repo = @get('repo')
|
||||||
|
limit = parseInt(@get('value'))
|
||||||
|
if limit
|
||||||
|
@set('isSaving', true)
|
||||||
|
savingFinished = =>
|
||||||
|
@set('isSaving', false)
|
||||||
|
|
||||||
|
repo.saveSettings(maximum_number_of_builds: limit).
|
||||||
|
then(savingFinished, savingFinished)
|
||||||
actions:
|
actions:
|
||||||
toggle: ->
|
toggle: ->
|
||||||
unless @get('enabled')
|
unless @get('enabled')
|
||||||
|
@ -26,15 +35,6 @@ LimitConcurrentBuildsComponent = Ember.Component.extend
|
||||||
@set('value', 0)
|
@set('value', 0)
|
||||||
|
|
||||||
limitChanged: ->
|
limitChanged: ->
|
||||||
repo = @get('repo')
|
Ember.run.debounce(this, 'limitChanged', 1000)
|
||||||
limit = parseInt(@get('value'))
|
|
||||||
if limit
|
|
||||||
@set('isSaving', true)
|
|
||||||
savingFinished = =>
|
|
||||||
@set('isSaving', false)
|
|
||||||
|
|
||||||
repo.saveSettings(maximum_number_of_builds: limit).
|
|
||||||
then(savingFinished, savingFinished)
|
|
||||||
|
|
||||||
|
|
||||||
`export default LimitConcurrentBuildsComponent`
|
`export default LimitConcurrentBuildsComponent`
|
||||||
|
|
Loading…
Reference in New Issue
Block a user