Improving admin filter.

Taking into account any sub menu items that match the query.
This commit is contained in:
Sipke Schoorstra
2014-07-14 00:18:50 -07:00
parent e410555577
commit 4c1985098a

View File

@@ -116,10 +116,13 @@
}
if (e.keyCode == 13) {
var firstVisibleItem = adminMenu.find("li a").filter(":visible");
var visibleItems = adminMenu.find("li a").filter(":visible");
if (firstVisibleItem.length > 0) {
location.href = firstVisibleItem.attr("href");
if (visibleItems.length > 0) {
var hit = visibleItems.filter(function(b, c) {
return $(c).text().toLowerCase().indexOf(a) !== -1;
});
location.href = hit.attr("href");
}
}
});