Minor fixes to group visualizations
diff --git a/public/css/vc.css b/public/css/vc.css
index 2b8058c..8c8326f 100644
--- a/public/css/vc.css
+++ b/public/css/vc.css
@@ -30,6 +30,10 @@
padding: .6em .5em;
}
+.vc .docGroup .docGroup {
+ display: block;
+}
+
.vc > .docGroup {
margin-left: 0;
}
diff --git a/public/js/spec/vcSpec.js b/public/js/spec/vcSpec.js
index 88b4734..da5ddaa 100644
--- a/public/js/spec/vcSpec.js
+++ b/public/js/spec/vcSpec.js
@@ -1,3 +1,9 @@
+/*
+Todo: In demoSpec: Create "and" on the last element of the top "or"-Group
+
+*/
+
+
// Helper method for building factories
buildFactory = function (objClass, defaults) {
return {
@@ -1648,4 +1654,56 @@
expect(vc.root().ldType()).toEqual('docGroup');
expect(vc.root().operation()).toEqual('or');
});
+
+ it ('should support multiple sub groups per group', function () {
+ var vc = KorAP.VirtualCollection.render(
+ {
+ "@type": 'korap:docGroup',
+ 'operation' : 'operation:or',
+ 'operands' : [
+ {
+ "@type": 'korap:docGroup',
+ 'operation' : 'operation:and',
+ 'operands' : [
+ {
+ "@type": 'korap:doc',
+ "key": 'title',
+ "value": 't1',
+ },
+ {
+ "@type" : 'korap:doc',
+ 'key' : 'title',
+ 'value' : 't2'
+ }
+ ]
+ },
+ {
+ "@type": 'korap:docGroup',
+ 'operation' : 'operation:and',
+ 'operands' : [
+ {
+ "@type": 'korap:doc',
+ "key": 'title',
+ "value": 't3',
+ },
+ {
+ "@type" : 'korap:doc',
+ 'key' : 'title',
+ 'value' : 't4'
+ }
+ ]
+ }
+ ]
+ }
+ );
+
+ expect(vc.toQuery()).toEqual('pubDate in 2014-12-05');
+ expect(vc.root().key()).toEqual('pubDate');
+ expect(vc.root().value()).toEqual('2014-12-05');
+
+ // Wrap on root
+ _orOn(vc.root());
+ expect(vc.root().ldType()).toEqual('docGroup');
+ expect(vc.root().operation()).toEqual('or');
+ });
});
diff --git a/public/js/src/hint.js b/public/js/src/hint.js
index 966cc78..4f5a8b5 100644
--- a/public/js/src/hint.js
+++ b/public/js/src/hint.js
@@ -31,7 +31,7 @@
"use strict";
// Don't let events bubble up
- if (Event.halt !== undefined) {
+ if (Event.halt === undefined) {
Event.prototype.halt = function () {
this.stopPropagation();
this.preventDefault();