From 361c5a23fcc85c1a2d73f98fb7d6c2d1e10099e6 Mon Sep 17 00:00:00 2001 From: trendschau Date: Thu, 5 Nov 2020 10:10:33 +0100 Subject: [PATCH] Version 1.4.1: Customfields disabled button and added transitions --- system/author/js/vue-meta.js | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) 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); }, },