Skip to content
Snippets Groups Projects
Commit 7763f2c0 authored by Timothee P's avatar Timothee P :sunflower:
Browse files

add description form for fast edition

parent d8237194
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@
required
maxlength="128"
name="title"
@blur="updateStore"
@blur="updateTitle"
>
</span>
<span v-else>
......@@ -146,7 +146,20 @@
</div>
<div class="ui hidden divider" />
<div class="sub header prewrap">
{{ currentFeature.description }}
<span
v-if="fastEditionMode && form"
class="form ui half-block"
>
<textarea
:value="form.description.value"
name="description"
rows="5"
@blur="updateDescription"
/>
</span>
<span v-else>
{{ currentFeature.description }}
</span>
</div>
</div>
</h1>
......@@ -244,8 +257,12 @@ export default {
.then(() => console.log('sent'));
},
updateStore(e) {
updateTitle(e) {
this.$store.commit('feature/UPDATE_FORM_FIELD', { name: 'title', value: e.target.value });
},
updateDescription(e) {
this.$store.commit('feature/UPDATE_FORM_FIELD', { name: 'description', value: e.target.value });
}
}
};
......
......@@ -40,7 +40,7 @@ const feature = {
};
},
UPDATE_FORM_FIELD(state, field) {
if (state.form[field.name].value) {
if (state.form[field.name].value !== undefined) {
state.form[field.name].value = field.value;
} else {
state.form[field.name] = field.value;
......
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