Fixed active first item on non-hint menus
diff --git a/dev/js/src/hint/menu.js b/dev/js/src/hint/menu.js
index bf965d7..4704bd2 100644
--- a/dev/js/src/hint/menu.js
+++ b/dev/js/src/hint/menu.js
@@ -15,6 +15,9 @@
obj._element.classList.add('hint');
obj._hint = hint;
+ // Make the top item always active
+ obj._firstActive = true;
+
// This is only domspecific
obj.element().addEventListener('blur', function (e) {
this.menu.hide();
diff --git a/dev/js/src/menu.js b/dev/js/src/menu.js
index cc42855..4b95ae9 100644
--- a/dev/js/src/menu.js
+++ b/dev/js/src/menu.js
@@ -4,6 +4,7 @@
* @author Nils Diewald
*/
/*
+ * TODO: First item shouldn't be automatically highlighted!
* TODO: space is not a valid prefix!
* TODO: Prefix should be case sensitive!
*/
@@ -215,6 +216,7 @@
this._limit = menuLimit;
this._position = 0; // position in the active list
this._active = -1; // active item in the item list
+ this._firstActive = false; // Show the first item active always?
this._reset();
return this;
},
@@ -285,7 +287,9 @@
// Set the first element to active
// Todo: Or the last element chosen
- this.liveItem(0).active(true);
+ if (this._firstActive)
+ this.liveItem(0).active(true);
+
this._prefix.active(false);
this._active = this._list[0];