image_annotation/commit

Sets context of annotation to 'unknown' if no info present in localstorage.

authorChris Dijkshoorn
Tue Jun 16 16:45:03 2015 +0200
committerChris Dijkshoorn
Tue Jun 16 16:45:03 2015 +0200
commitfaf67ed4e6c7c09853356f46e03252356a21d811
treebab75fd4131a213801725c65b0516c0dab51d299
parentcb353a8f5f47343b703f13c81eb0421194713aec
Diff style: patch stat
diff --git a/web/js/annotation.js b/web/js/annotation.js
index 708fbf9..0fd3381 100644
--- a/web/js/annotation.js
+++ b/web/js/annotation.js
@@ -761,14 +761,16 @@ YUI.add('annotation', function(Y) {
 		var context = "";
 		var index = parseInt(localStorage.getItem("itemIndex"));
 		var clusterId = parseInt(localStorage.getItem("clusterId"));
-		if(query === "expertise values") {
+		
+		if(typeof domainSettings == 'undefined') {
+			context = "unknown";
+		} else if(query === "expertise values") {
 			context = "recommendation, " + index + ", " + clusterId;
 		} else if (query !== "") {
 			context = "search, " + query + ", " + index + ", " + clusterId;
 		} else {
 			context = "unknown";
 		}
-		console.log("Context", context);
 		
 		Y.io(this.get("store.add"), {
 		    method: "POST",