Make font feedback red on error
This commit is contained in:
parent
ff427d0354
commit
cf2c691585
2 changed files with 10 additions and 7 deletions
|
@ -50,12 +50,12 @@ class Feedback extends ElemJS {
|
|||
this.loading = state
|
||||
}
|
||||
|
||||
message(content) {
|
||||
if (content) {
|
||||
this.class("form-feedback")
|
||||
} else {
|
||||
this.removeClass("form-feedback")
|
||||
}
|
||||
message(content, isError) {
|
||||
this.removeClass("form-feedback")
|
||||
this.removeClass("form-error")
|
||||
if (content) this.class("form-feedback")
|
||||
if(isError) this.class("form-error")
|
||||
|
||||
this.messageSpan.text(content)
|
||||
}
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ class Form extends ElemJS {
|
|||
cancel(message) {
|
||||
this.processing = false
|
||||
feedback.setLoading(false)
|
||||
feedback.message(message)
|
||||
feedback.message(message, true)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,9 @@
|
|||
width: 100%
|
||||
margin: -0.5em 0 -0.8em
|
||||
|
||||
.form-error
|
||||
color: red
|
||||
|
||||
@keyframes spin
|
||||
0%
|
||||
transform: rotate(0deg)
|
||||
|
|
Loading…
Reference in a new issue