From 7c896768cee1f1dc9bb1905fba5561674c778a35 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Wed, 24 Sep 2014 16:01:34 -0400 Subject: [PATCH] case insensitive acp searching --- public/src/forum/admin/footer.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/public/src/forum/admin/footer.js b/public/src/forum/admin/footer.js index ecd54295a0..015dcc0327 100644 --- a/public/src/forum/admin/footer.js +++ b/public/src/forum/admin/footer.js @@ -9,7 +9,7 @@ define('forum/admin/footer', ['forum/admin/settings'], function(Settings) { acpIndex = data; for (var file in acpIndex) { if (acpIndex.hasOwnProperty(file)) { - acpIndex[file] = $(acpIndex[file]).text(); + acpIndex[file] = $(acpIndex[file]).text().toLowerCase(); } } @@ -22,12 +22,13 @@ define('forum/admin/footer', ['forum/admin/settings'], function(Settings) { $('#acp-search input').on('keyup focus', function() { var $input = $(this), + value = $input.val().toLowerCase(), menuItems = $('#acp-search .dropdown-menu').html(''); - if ($input.val().length > 3) { + if (value.length > 3) { for (var file in acpIndex) { if (acpIndex.hasOwnProperty(file)) { - if (acpIndex[file].indexOf($input.val()) !== -1) { + if (acpIndex[file].indexOf(value) !== -1) { var href = file.replace('.tpl', ''), title = href.replace(/^\/admin\//, '').split('/'); @@ -45,13 +46,13 @@ define('forum/admin/footer', ['forum/admin/settings'], function(Settings) { } } } - + if (menuItems.html() !== '') { menuItems.append(''); } } - menuItems.append('
  • Search the forum for "' + $input.val() + '"
  • '); + menuItems.append('
  • Search the forum for "' + value + '"
  • '); }); } }); \ No newline at end of file