From fae4809fc727ae409d383baa0b9d040d332a48f2 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Thu, 7 Sep 2017 14:24:58 +0200 Subject: [PATCH] Applied QA to match Zammad code style. --- public/assets/form/form.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/public/assets/form/form.js b/public/assets/form/form.js index c39da9cbf..b8d0456fd 100644 --- a/public/assets/form/form.js +++ b/public/assets/form/form.js @@ -26,6 +26,7 @@ $(function() { tag: 'input', type: 'text', placeholder: 'Your Name', + defaultValue: '', }, { display: 'Email', @@ -33,12 +34,14 @@ $(function() { tag: 'input', type: 'email', placeholder: 'Your Email', + defaultValue: function () {return User.email;}, }, { display: 'Message', name: 'body', tag: 'textarea', placeholder: 'Your Message...', + defaultValue: '', rows: 7, }, { @@ -73,23 +76,23 @@ $(function() { name: 'name', tag: 'input', type: 'text', - value: '', placeholder: 'Your Name', + defaultValue: '', }, { display: 'Email', name: 'email', tag: 'input', type: 'email', - value: '', placeholder: 'Your Email', + defaultValue: '', }, { display: 'Message', name: 'body', tag: 'textarea', placeholder: 'Your Message...', - value: '', + defaultValue: '', rows: 7, }, ], @@ -363,14 +366,14 @@ $(function() { $form.append('

' + this.options.messageTitle + '

') } $.each(this.options.attributes, function(index, value) { - var item = $('
') - var _defaultValue = (typeof value.value === 'function') ? value.value() : value.value; + var item = $('
'); + var defaultValue = (typeof value.defaultValue === 'function') ? value.defaultValue() : value.defaultValue; for (var i=0; i < (value.repeat ? value.repeat : 1); i++) { if (value.tag == 'input') { - item.append('') + item.append('') } else if (value.tag == 'textarea') { - item.append('') + item.append('') } } $form.append(item)