Added update to assure graying corpus statistic by deleting the first line in vc builder(plus test)

Change-Id: Id44736f134c00e1a1be002bf14e00e6efa26ad02
(cherry picked from commit 4c4c3eb9de42c3c61547b475bd0b48ae509c2c67)
diff --git a/dev/js/spec/statSpec.js b/dev/js/spec/statSpec.js
index ec114eb..f0e4b8b 100644
--- a/dev/js/spec/statSpec.js
+++ b/dev/js/spec/statSpec.js
@@ -372,10 +372,11 @@
         let rlbutton = show.getElementsByClassName("refresh").item(0);
         rlbutton.click();
         expect(checkStatActive(view,show)).toBe(true);   
-            
+        
         KorAP._delete.apply(KorAP.vc.root());
-        // fails momentarily, does not fail after next commit with Change-Id: Id44736f134c00e1a1be002bf14e00e6efa26ad02
-        //expect(checkStatDisabled(view, show)).toBe(true);        
+        view = panel.firstChild.firstChild;
+        expect(checkStatDisabled(view, show)).toBe(true);     
+      
       });
       
       
diff --git a/dev/js/src/vc.js b/dev/js/src/vc.js
index 0431f92..af09132 100644
--- a/dev/js/src/vc.js
+++ b/dev/js/src/vc.js
@@ -242,13 +242,15 @@
 
     
     /**
-     * Clean the virtual document to uspecified doc.
+     * Clean the virtual document to unspecified doc.
      */
     clean : function() {
       if (this._root.ldType() !== "non") {
         this._root.destroy();
         this.root(unspecDocClass.create(this));
       };
+      //update for graying corpus statistic by deleting the first line of the vc builder
+      this.update();
       return this;
     },
 
diff --git a/dev/js/src/view/corpstatv.js b/dev/js/src/view/corpstatv.js
index 44a9ae2..8e7b965 100644
--- a/dev/js/src/view/corpstatv.js
+++ b/dev/js/src/view/corpstatv.js
@@ -107,10 +107,9 @@
     /**
      * Checks if graying necessary
      */
-    checkGrayingStatistic : function (){   
+    checkGrayingStatistic : function (){
      var newString = KorAP.vc.toQuery();
      var oldString = this.vc.oldvcQuery;
-     
      /*
       * Do ignore surrounding round brackets
       * Definining an incomplete docGroup in the vc builder: 
@@ -118,13 +117,16 @@
       * leads to 
       * vc.toQuery() -> (foo = bar and author=Goethe)
       */
-     if(newString.startsWith('(')){
-       newString = newString.slice(1, newString.length-1);
+  
+     if(newString || newString === ''){
+       if(newString.startsWith('(')){
+         newString = newString.slice(1, newString.length-1);
+       }
+       if(newString != oldString) {
+        this.grayingStat();
+      }  
      }
      
-      if(newString && newString != oldString) {
-        this.grayingStat();
-      }   
    },
    
     /**