Add dynamic loading of javascript configurations (closes #173)
Change-Id: Icfb6082aee88930eca2361196b8d91ff5a796172
diff --git a/dev/js/src/hint.js b/dev/js/src/hint.js
index e700b94..ee5e344 100644
--- a/dev/js/src/hint.js
+++ b/dev/js/src/hint.js
@@ -25,11 +25,15 @@
'hint/contextanalyzer',
'hint/alert',
'util'
-], function (inputClass,
+], function (inputClass,
menuClass,
analyzerClass,
alertClass) {
+ //needed for localization
+ const loc = KorAP.Locale;
+ loc.HINT_noAnnot = loc.HINT_noAnnot || 'The assistant can not be displayed.';
+
// Initialize hint array
/**
@@ -266,10 +270,13 @@
* @param {boolean} Boolean value to indicate if context
* is necessary (true) or if the main context should
* be shown if context fails.
- *
+ *
*/
show : function (ifContext) {
-
+ if(KorAP.annotationHelper["-"].length == 0){
+ this.alert(0,loc.HINT_noAnnot);
+ return;
+ }
// Remove the active object
this._unshow();