Mark invalid concurrent setting input properly.
This adds a CSS class if the content is invalid.
This commit is contained in:
parent
ce9322443c
commit
d3b13d8238
|
@ -58,10 +58,11 @@ Travis.RepoSettingsController = Em.ObjectController.extend
|
|||
|
||||
settingsChanged: (->
|
||||
if parseInt(@get('settings.maximum_number_of_builds')) > 0
|
||||
@set('settings.maximum_number_of_builds_valid', '')
|
||||
@get('model').saveSettings(@get('settings')).then null, ->
|
||||
Travis.flash(error: 'There was an error while saving settings. Please try again.')
|
||||
else
|
||||
Travis.flash(error: 'The maximum number of concurrent builds needs to be a number greater than zero.')
|
||||
@set('settings.maximum_number_of_builds_valid', 'invalid')
|
||||
).observes('settings.maximum_number_of_builds')
|
||||
|
||||
save: ->
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
</div>
|
||||
|
||||
<div class="settings-row">
|
||||
<div class="short-settings-element">
|
||||
<div class="short-settings-element" {{bind-attr class="settings.maximum_number_of_builds_valid"}}>
|
||||
{{input value=settings.maximum_number_of_builds size="4" pattern='/^[0-9]+$/'}}
|
||||
</div>
|
||||
<label>
|
||||
|
|
|
@ -21,4 +21,10 @@
|
|||
margin: 0px 15px
|
||||
display: inline-block
|
||||
|
||||
.invalid
|
||||
input
|
||||
border-width: 1px
|
||||
border-color: red
|
||||
background: #ffb6c1
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user