Make VC replaceable via KorAP.vc.fromJson(...)
Change-Id: Ic7de60fd4b67036e52467b8c0c99b59d504a240b
diff --git a/dev/js/src/vc/docgroup.js b/dev/js/src/vc/docgroup.js
index c73a325..3a22034 100644
--- a/dev/js/src/vc/docgroup.js
+++ b/dev/js/src/vc/docgroup.js
@@ -210,8 +210,10 @@
group.appendChild(op.element());
- var vcchevent = new CustomEvent('vcChange', {'detail':this});
- KorAP.vc.element().dispatchEvent(vcchevent);
+ if (KorAP.vc) {
+ var vcchevent = new CustomEvent('vcChange', {'detail':this});
+ KorAP.vc.element().dispatchEvent(vcchevent);
+ };
return this;
},