accurator/commit

Corrected form initation and added type to text input.

authorChris Dijkshoorn
Mon Apr 4 09:43:55 2016 +0200
committerChris Dijkshoorn
Mon Apr 4 09:43:55 2016 +0200
commit001510d65cd29730857fab274c794169f23ae9d0
treeab0cfb57af5de3d75115f688d5a5ee75e2c225fe
parent4160a76594c0d3f60d8e762d6d34309ed94d6a19
Diff style: patch stat
diff --git a/web/js/components/form.js b/web/js/components/form.js
index b29b6da..b3bb6ac 100644
--- a/web/js/components/form.js
+++ b/web/js/components/form.js
@@ -115,6 +115,7 @@ Form.prototype.addFormQuestions = function(labelData) {
             this.formGroups[i] = new TextFormGroup(
                 this.groupIds[i],
                 labelData.formLblBirthDate,
+                'date',
                 2
             );
         }
@@ -163,6 +164,7 @@ Form.prototype.addFormQuestions = function(labelData) {
             this.formGroups[i] = new TextFormGroup(
                 this.groupIds[i],
                 labelData.formLblMail,
+                'text',
                 5
             );
         }
@@ -353,9 +355,10 @@ FormGroup.prototype.init = function() {
 TextFormGroup
 *******************************************************************************/
 
-function TextFormGroup(id, label, size) {
+function TextFormGroup(id, label, type, size) {
     FormGroup.call(this, id, label);
     this.size = size;
+    this.type = type;
     this.addTextField();
 }
 
@@ -367,13 +370,14 @@ TextFormGroup.prototype.addTextField = function() {
         $(this.node).find("div").addClass('col-sm-' + this.size);
         $(this.node).find("div").removeClass('col-sm-5');
     }
+
     $(this.node).find("label").attr("for", "formInp" + this.id);
 
     $(this.node).find("div").append(
         $.el.input({
             'class':'form-control',
             'id':'formInp' + this.id,
-            'type':'date'
+            'type':this.type
         })
     );
 }
diff --git a/web/js/item.js b/web/js/item.js
index c770f35..b7c3b97 100644
--- a/web/js/item.js
+++ b/web/js/item.js
@@ -121,7 +121,7 @@ function events(user, locale, labels) {
 			alertMessage(labels.itemHdrFirst, labels.itemTxtFirst, 'success');
 		}
 
-		if(annotations.length === 5) {
+		if(annotations.length === 1) {
 			var formPersonal = new Form(
 				"formPersonal",
 				["country", "language", "education", "gender", "birthDate"],
@@ -133,7 +133,7 @@ function events(user, locale, labels) {
 			});
 		}
 
-		if(annotations.length === 1) {
+		if(annotations.length === 10) {
 			var formInternet = new Form(
 				"formInternet",
 				["socialNetwork", "taggingSites", "taggingExperience", "mail", "mailCheck"],