diff --git a/system/author/js/vue-meta.js b/system/author/js/vue-meta.js
index 9203a7f..b60b131 100644
--- a/system/author/js/vue-meta.js
+++ b/system/author/js/vue-meta.js
@@ -380,26 +380,29 @@ Vue.component('component-customfields', {
return {
fielderrors: false,
fielddetails: {},
+ disableaddbutton: false,
}
},
template: '
' +
'
' +
'
{{ description|translate }}
' +
'
{{ errors[name] }}
' +
- '
{{ fielderrors }}
' +
- '
' +
- '
' +
- '
' +
- '
' +
- '
' +
- '
' +
- '
' +
+ '
{{ fielderrors }}
' +
+ '
' +
+ '' +
+ '
' +
+ '
' +
+ '
' +
+ '
' +
+ '
' +
+ '' +
+ '
' +
'
',
mounted: function(){
-
if(this.value === null)
{
this.value = [{}];
+ this.disableaddbutton = 'disabled';
}
},
methods: {
@@ -419,16 +422,19 @@ Vue.component('component-customfields', {
{
this.value[index].keyerror = 'red';
this.fielderrors = 'Error: The key already exists';
+ this.disableaddbutton = 'disabled';
return;
}
else if(!regex.test(event.target.value))
{
this.value[index].keyerror = 'red';
this.fielderrors = 'Error: Only alphanumeric for keys allowed';
+ this.disableaddbutton = 'disabled';
return;
}
delete this.value[index].keyerror;
+ this.disableaddbutton = false;
this.update(this.value,this.name);
},
keyIsUnique: function(keystring, index)
@@ -467,12 +473,13 @@ Vue.component('component-customfields', {
return;
}
}
-
this.value.push({});
+ this.disableaddbutton = 'disabled';
},
deleteField: function(index)
{
this.value.splice(index,1);
+ this.disableaddbutton = false;
this.update(this.value,this.name);
},
},