diff --git a/public/src/forum/admin/footer.js b/public/src/forum/admin/footer.js index 81dca5ce2f..d2a33e3110 100644 --- a/public/src/forum/admin/footer.js +++ b/public/src/forum/admin/footer.js @@ -86,7 +86,7 @@ define('forum/admin/footer', ['forum/admin/settings'], function(Settings) { if (acpIndex.hasOwnProperty(file)) { acpIndex[file] = acpIndex[file].replace(/' + acpIndex[file] + ''); - acpIndex[file].find('ul.nav, script').remove(); + acpIndex[file].find('script').remove(); acpIndex[file] = acpIndex[file].text().toLowerCase().replace(/[ |\r|\n]+/g, ' '); } @@ -100,12 +100,17 @@ define('forum/admin/footer', ['forum/admin/settings'], function(Settings) { } function setupACPSearch() { - var menu = $('#acp-search .dropdown-menu'); + var menu = $('#acp-search .dropdown-menu'), + routes = []; $('#acp-search input').on('keyup', function() { $('#acp-search .dropdown').addClass('open'); }); + $('.sidebar-nav a').each(function(idx, link) { + routes.push($(link).attr('href')); + }); + $('#acp-search input').on('keyup focus', function() { var $input = $(this), value = $input.val().toLowerCase(), @@ -135,8 +140,11 @@ define('forum/admin/footer', ['forum/admin/settings'], function(Settings) { } title = title.join(' > '); + href = RELATIVE_PATH + href; - menuItems.append('
  • ' + title + '
    ...' + description + '...
  • '); + if ($.inArray(href, routes) !== -1) { + menuItems.append('
  • ' + title + '
    ...' + description + '...
  • '); + } } } }