Update Changes
diff --git a/Changes b/Changes
index f06d174..131799b 100755
--- a/Changes
+++ b/Changes
@@ -4,6 +4,7 @@
- Added alert to hint helper.
- Improved menu creation.
- Introduced benchmark system.
+ - select elements are now improved menus.
0.20 2016-05-25
- Improved menu using sliders.
diff --git a/dev/js/spec/menuSpec.js b/dev/js/spec/menuSpec.js
index 09848fc..c13d5e6 100644
--- a/dev/js/spec/menuSpec.js
+++ b/dev/js/spec/menuSpec.js
@@ -360,7 +360,7 @@
menu._firstActive = true;
expect(menu.itemClass()).toEqual(KorAP.OwnMenuItem);
expect(menu.element().nodeName).toEqual('UL');
- expect(menu.element().style.opacity).toEqual("0");
+ expect(menu.element().classList.contains('visible')).toBeFalsy();
expect(menu.limit()).toEqual(8);
menu.limit(9);
diff --git a/dev/js/src/init.js b/dev/js/src/init.js
index e79837b..eafb021 100644
--- a/dev/js/src/init.js
+++ b/dev/js/src/init.js
@@ -196,11 +196,19 @@
if (KorAP.koralQuery["errors"]) {
var errors = KorAP.koralQuery["errors"];
for (var i in errors) {
- if (errors[i][0] === 302) {
+
+ // Malformed query
+ if (errors[i][0] === 302 && errors[i][2]) {
obj.hint = hintClass.create();
obj.hint.alert(errors[i][2], errors[i][1]);
break;
}
+
+ // no query
+ else if (errors[i][0] === 301) {
+ obj.hint = hintClass.create();
+ obj.hint.alert(0, errors[i][1]);
+ }
}
};
diff --git a/dev/js/src/selectMenu.js b/dev/js/src/selectMenu.js
index 3e5c605..db5a52b 100644
--- a/dev/js/src/selectMenu.js
+++ b/dev/js/src/selectMenu.js
@@ -40,10 +40,8 @@
obj._title.appendChild(document.createTextNode(''));
obj._container.appendChild(obj.element());
-
obj._container.addEventListener('click', obj.showSelected.bind(obj));
-
// Add index information to each item
for (i in obj._items) {
obj._items[i]._index = i;