Fix requirement of KorAP.vc in docGroupRef
Change-Id: I9b273e460f40d09e2aad33b69a922f15328fc7ac
diff --git a/dev/js/src/vc/docgroupref.js b/dev/js/src/vc/docgroupref.js
index 5a9196b..3709c63 100644
--- a/dev/js/src/vc/docgroupref.js
+++ b/dev/js/src/vc/docgroupref.js
@@ -60,12 +60,12 @@
// Set ref - TODO: Cleanup!
e.refTo = t;
-
+
// Was rewritten
if (t.rewrites() !== undefined) {
e.classList.add("rewritten");
};
-
+
const refTitle = document.createElement('span');
refTitle.classList.add('key','fixed', 'ref');
refTitle.addT('referTo');
@@ -101,7 +101,7 @@
if (t._rewrites !== undefined) {
e.appendChild(t._rewrites.element());
};
-
+
if (t._parent !== undefined) {
// Set operators
@@ -112,10 +112,12 @@
true
).element());
};
-
- KorAP.vc.element().dispatchEvent(
- new CustomEvent('vcChange', { 'detail' : t })
- );
+
+ if (KorAP.vc !== undefined) {
+ KorAP.vc.element().dispatchEvent(
+ new CustomEvent('vcChange', { 'detail' : t })
+ );
+ };
return t.element();
},