Skip to content
Snippets Groups Projects
Commit 0f4ce4f7 authored by Florent Lavelle's avatar Florent Lavelle
Browse files

add message when reaching max length on input

parent 78956510
No related branches found
No related tags found
No related merge requests found
...@@ -162,6 +162,12 @@ body { ...@@ -162,6 +162,12 @@ body {
color: #9f3a38; color: #9f3a38;
} }
#form-layers .infoslist{
list-style: none;
padding-left: 0;
color: #38989f;
}
/* Fix semantic ui overflow when is too long */ /* Fix semantic ui overflow when is too long */
.layer-item .form div.text { .layer-item .form div.text {
width: 100% width: 100%
...@@ -224,13 +230,26 @@ body { ...@@ -224,13 +230,26 @@ body {
padding: 0; padding: 0;
} }
.infoslist {
margin-top: 0.1rem;
padding: 0;
}
.errorlist > li { .errorlist > li {
list-style: none; list-style: none;
color: rgb(177, 55, 55); color: rgb(177, 55, 55);
border: thin solid rgb(197, 157, 157); border: thin solid rgb(197, 157, 157);
border-radius: 3px; border-radius: 3px;
background-color: rgb(250, 241, 242); background-color: rgb(250, 241, 242);
padding: 1rem; padding: 0.5rem 1rem;
}
.infoslist > li {
list-style: none;
color: #38989f;
border-radius: 3px;
padding: 0;
text-align: right;
} }
/* ---------------------------------- */ /* ---------------------------------- */
......
...@@ -32,6 +32,17 @@ ...@@ -32,6 +32,17 @@
:name="form.title.html_name" :name="form.title.html_name"
@blur="updateStore" @blur="updateStore"
> >
<ul
id="infoslist-title"
class="infoslist"
>
<li
v-for="info in form.title.infos"
:key="info"
>
{{ info }}
</li>
</ul>
<ul <ul
id="errorlist-title" id="errorlist-title"
class="errorlist" class="errorlist"
...@@ -379,6 +390,7 @@ export default { ...@@ -379,6 +390,7 @@ export default {
form: { form: {
title: { title: {
errors: [], errors: [],
infos: [],
id_for_label: 'name', id_for_label: 'name',
field: { field: {
max_length: 128, max_length: 128,
...@@ -491,6 +503,16 @@ export default { ...@@ -491,6 +503,16 @@ export default {
}, },
}, },
watch: {
'form.title.value': function(newValue) {
if (newValue.length === 128) {
this.form.title.infos.push('Le nombre de caractères et limité à 128.');
} else {
this.form.title.infos = [];
}
}
},
created() { created() {
this.$store.commit( this.$store.commit(
'feature-type/SET_CURRENT_FEATURE_TYPE_SLUG', 'feature-type/SET_CURRENT_FEATURE_TYPE_SLUG',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment