Circumvent value checking on dates when newly created in VC builder

Change-Id: Idcf378960d863a3072213d7070c7ac75876438db
diff --git a/dev/js/spec/vcSpec.js b/dev/js/spec/vcSpec.js
index 8e745e1..ae62f10 100644
--- a/dev/js/spec/vcSpec.js
+++ b/dev/js/spec/vcSpec.js
@@ -625,7 +625,7 @@
       expect(docGroup.getOperand(1).key("name")).not.toBeNull();
       expect(docGroup.getOperand(1).ldType()).toEqual("doc");
       expect(docGroup.getOperand(1).key()).toEqual("name");
-      expect(docGroup.getOperand(1).value()).toEqual("");
+      expect(docGroup.getOperand(1).value()).toBeUndefined();
 
       op = docGroup.getOperand(1).element().lastChild;
       expect(op.getAttribute('class')).toEqual('operators button-group');
@@ -664,6 +664,21 @@
       expect(op.children[2].getAttribute('class')).toEqual('delete');
       expect(op.children.length).toEqual(3);
     });
+
+    it('should be clickable', function () {
+      var vc = vcClass.create([
+        ["pubDate", "date"]
+      ]);
+      expect(vc.toQuery()).toEqual("");
+      expect(vc.element().firstChild.textContent).toEqual("⋯");
+      vc.element().firstChild.firstChild.click();
+
+      // Click on pubDate
+      vc.element().firstChild.getElementsByTagName("LI")[0].click();
+
+      expect(vc.element().firstChild.firstChild.textContent).toEqual("pubDate");
+      expect(vc.element().firstChild.children[1].getAttribute("data-type")).toEqual("date");
+    });    
   });
 
   describe('KorAP.Doc element', function () {
diff --git a/dev/js/src/menu.js b/dev/js/src/menu.js
index b2ec25b..9f3cf75 100644
--- a/dev/js/src/menu.js
+++ b/dev/js/src/menu.js
@@ -782,6 +782,8 @@
 
     // Set boundary for viewport
     _boundary : function (bool) {
+      if (this._list.length === 0)
+        return;
       this.item(this._list[0]).noMore(bool);
       this.item(this._list[this._list.length - 1]).noMore(bool);
     },
diff --git a/dev/js/src/vc/doc.js b/dev/js/src/vc/doc.js
index 41b72ad..bdedb70 100644
--- a/dev/js/src/vc/doc.js
+++ b/dev/js/src/vc/doc.js
@@ -34,6 +34,10 @@
           upgradeTo(this).
           fromJson(json);
 
+      if (obj === undefined) {
+        console.log(json);
+      };
+
       // Bind the parent
       if (parent !== undefined)
         obj._parent = parent;
@@ -209,6 +213,7 @@
           // Check the VC list if the field is known
           var type = KorAP._vcKeyMenu.typeOf(this.key());
           if (type != undefined) {
+            console.log("Guessed the type for " + this.key() + " to be " + type);
             json["type"] = "type:" + type;
           };
         };
diff --git a/dev/js/src/vc/unspecified.js b/dev/js/src/vc/unspecified.js
index 0395685..56d0869 100644
--- a/dev/js/src/vc/unspecified.js
+++ b/dev/js/src/vc/unspecified.js
@@ -41,12 +41,9 @@
 	      return null;
 
       // Set JSON-LD type
-      var newDoc = docClass.create(this._parent, {
-	      "@type" : "koral:doc",
-	      "value" : "",
-	      "key"   : v
-      });
-
+      var newDoc = docClass.create(this._parent);
+      newDoc.key(v);
+  
       // Unspecified document on root
       if (this._parent.ldType() === null) {
 	      this._parent.root(newDoc);
@@ -120,6 +117,7 @@
 
       // Get the key menu
       var menu = KorAP._vcKeyMenu;
+
       // Add key menu element at the correct position
       this._element.insertBefore(
 	      menu.element(),