From 77f45c1508a630e070e9d5c68d412e0773674f44 Mon Sep 17 00:00:00 2001 From: ogerly Date: Wed, 24 Jul 2019 15:35:08 +0200 Subject: [PATCH] esoolved comments @tirokk --- .../ContributionForm/ContributionForm.vue | 35 ++++++++++++++----- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/webapp/components/ContributionForm/ContributionForm.vue b/webapp/components/ContributionForm/ContributionForm.vue index 32d26ad2c..b506305db 100644 --- a/webapp/components/ContributionForm/ContributionForm.vue +++ b/webapp/components/ContributionForm/ContributionForm.vue @@ -10,7 +10,7 @@ /> - {{ form.title.length }}/64 + {{ form.title.length }}/{{formSchema.title.max }} - {{ form.contentLength }}/2000 + {{ form.contentLength }}/{{content_max }} ]+(>|$)/gm, '').length - this.form.contentLength = n - if (n > this.formSchema.content.min && this.formSchema.content.max > n) { + // TODO: Do smth????? what is happening + this.$refs.contributionForm.update('content', value) + // filter HTML out of content value + const str = value.replace(/<\/?[^>]+(>|$)/gm, '') + // Set counter length of text + this.form.contentLength = str.length + //Enable save button if requirements are met + if ( str.length >= this.content_min && + str.length <= this.content_max) + { this.disabled = false } },