cleanup code
Change-Id: I93aa205581f046ce7a4a5129fc1ea8033126a829
diff --git a/dev/js/src/loc/de.js b/dev/js/src/loc/de.js
index f6e53c3..cb92830 100644
--- a/dev/js/src/loc/de.js
+++ b/dev/js/src/loc/de.js
@@ -14,8 +14,6 @@
loc.VC_allCorpora = 'allen Korpora';
loc.VC_oneCollection = 'einem virtuellen Korpus';
- //Show corpus statistic
- loc.VC_SHOWSTAT = 'Korpusstatistik';
// Date picker:
loc.WDAY = ['Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa', 'So'];
@@ -36,4 +34,9 @@
loc.SHOW_KQ = 'zeige KoralQuery';
loc.SHOW_META = 'Metadaten';
loc.NEW_QUERY = 'Neue Anfrage';
+
+ //Corpus statistic
+ loc.SHOWSTAT = 'Korpusstatistik';
+ //verbose description, for title attributes for example
+ //loc.VERB_SHOWSTAT = 'Korpusstatistik';
});
diff --git a/dev/js/src/vc.js b/dev/js/src/vc.js
index d211830..1726ca2 100644
--- a/dev/js/src/vc.js
+++ b/dev/js/src/vc.js
@@ -264,8 +264,13 @@
// Initialize root
this._element.appendChild(this._root.element());
- //Add corpus statistic button
- this.addStatBut();
+ /* TODO by Helge
+ Hack! additional div, because statistic button is removed after
+ choosing and/or/x in vc builder. REMOVE this lines after solving the problem!!!! */
+ this._element.addE('div');
+ this._element.addE('div');
+ //Add corpus statistic button
+ this.addStatBut();
return this._element;
},
@@ -343,11 +348,11 @@
* Adds Corpus Statistic Button
**/
addStatBut : function(){
-
- //add div element 'corpStat' with id 'dCorpStat'
+
+ //add div element 'corpStat'
var dv = this._element.addE('div');
- dv.id = "dCorpStat";
-
+ dv.classList.add('dCorpStat');
+
//add button
var bu = dv.addE('div');
bu.classList.add('bottom', 'button-stat');
diff --git a/dev/js/src/vc/statistic.js b/dev/js/src/vc/statistic.js
index 4a40ea5..5407e8f 100644
--- a/dev/js/src/vc/statistic.js
+++ b/dev/js/src/vc/statistic.js
@@ -69,7 +69,12 @@
*/
getStatistic : function(vc, cb){
//cq = corpusQuery
- var cq = encodeURI(vc.toQuery());
+
+ //console.log("HK ld-Type corpus = " + vc.getLdType());
+
+ var cq;
+
+ cq = encodeURI(vc.toQuery());
try{
KorAP.API.getCorpStat(cq, function(statResponse){
@@ -86,6 +91,7 @@
if(statResponse["notifications"] !== null && statResponse["notifications"] !== undefined ){
notif = statResponse["notifications"];
KorAP.log(0, notif[0][1]);
+ cb(null);
return;
}
@@ -125,13 +131,13 @@
* append result to statTable
*/
this.getStatistic(vc, function (statistic) {
+
+ statTable.classList.remove('loading');
+ statisticobj = that.create(statistic);
if (statistic === null)
return;
-
- statTable.classList.remove('loading');
- statisticobj = that.create(statistic);
-
+
statTable.appendChild(statisticobj.element());
// Add Close Button