Refresh corpus statistic by clicking at statistic button - fixes #107
Change-Id: I2b73529d495028017c789b633f69aa28f74ef16d
diff --git a/dev/js/src/panel/vc.js b/dev/js/src/panel/vc.js
index 91fb544..39deef5 100644
--- a/dev/js/src/panel/vc.js
+++ b/dev/js/src/panel/vc.js
@@ -40,12 +40,23 @@
* Add corpus statistic view to panel
*/
addCorpStat: function(){
+
+ //Refreshes corpus statistic
+ if(this.statView !== undefined && this.statView.shown()){
+ let statt = this.statView.show();
+ if (statt.classList.contains('stdisabled')){
+ this.reloadCorpStat();
+ statt.classList.remove('stdisabled');
+ }
+ }
+
+ //Add corpus statistic
if (this.statView === undefined || !this.statView.shown()) {
this.statView = corpStatVClass.create(this.vc, this);
this.add(this.statView);
this.vc.oldvcQuery = KorAP.vc.toQuery();
}
-
+
},
/**