Removes collapse event binding from computed property function in TainacanFormItem (was causing a loop). Closes #57.
This commit is contained in:
parent
2e8cfd5dd8
commit
be7eb7b544
|
@ -5,10 +5,10 @@
|
|||
:type="fieldTypeMessage">
|
||||
<span
|
||||
class="collapse-handle"
|
||||
@click="$emit('changeCollapse', !isCollapsed)">
|
||||
@click="$emit('changeCollapse', fieldTypeMessage != 'is-danger' ? !isCollapsed : true)">
|
||||
<b-icon
|
||||
type="is-secondary"
|
||||
:icon="isCollapsed ? 'menu-down' : 'menu-right'" />
|
||||
:icon="isCollapsed || fieldTypeMessage == 'is-danger' ? 'menu-down' : 'menu-right'" />
|
||||
<label class="label">{{ field.field.name }}</label>
|
||||
<span
|
||||
v-if="field.field.required == 'yes'"
|
||||
|
@ -20,7 +20,7 @@
|
|||
:message="field.field.description"/>
|
||||
</span>
|
||||
<div
|
||||
v-show="isCollapsed"
|
||||
v-show="isCollapsed || fieldTypeMessage == 'is-danger'"
|
||||
v-if="isTextInputComponent( field.field.field_type_object.component )">
|
||||
<component
|
||||
:id="field.field.field_type_object.component + '-' + field.field.slug"
|
||||
|
@ -92,7 +92,7 @@
|
|||
this.setFieldTypeMessage('is-danger');
|
||||
for (let error of errors) {
|
||||
for (let index of Object.keys(error)) {
|
||||
//this.$console.log(index);
|
||||
// this.$console.log(index);
|
||||
msg += error[index] + '\n';
|
||||
}
|
||||
}
|
||||
|
@ -133,8 +133,6 @@
|
|||
},
|
||||
setFieldTypeMessage( message ){
|
||||
this.fieldTypeMessage = message;
|
||||
if (message != '')
|
||||
this.$emit('changeCollapse', true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ export const eventBus = new Vue({
|
|||
},
|
||||
updateValue(data){
|
||||
if ( data.item_id ){
|
||||
|
||||
let values = ( Array.isArray( data.values[0] ) ) ? data.values[0] : data.values ;
|
||||
const promisse = this.$store.dispatch('item/updateMetadata',
|
||||
{ item_id: data.item_id, field_id: data.field_id, values: values });
|
||||
|
@ -62,7 +63,7 @@ export const eventBus = new Vue({
|
|||
});
|
||||
}
|
||||
},
|
||||
getErrors(field_id){
|
||||
getErrors(field_id) {
|
||||
let error = this.errors.find( errorItem => errorItem.field_id == field_id );
|
||||
return ( error ) ? error.errors : false
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue