From 429ca83e5aab63984183b9bf3e106c1a117e2c93 Mon Sep 17 00:00:00 2001 From: sun Date: Mon, 16 Jan 2012 01:57:32 +0100 Subject: [PATCH] Fixed missing contexts. --- admin_menu.js | 20 +++++++++++--------- 1 files changed, 11 insertions(+), 9 deletions(-) diff --git a/admin_menu.js b/admin_menu.js index e6496e2..440750f 100644 --- a/admin_menu.js +++ b/admin_menu.js @@ -260,24 +260,26 @@ Drupal.admin.behaviors.search = function (context, settings, $adminMenu) { // Select all links that match the search term and are not siblings // of the actions menu. // Separate selector and .filter() to leverage Sizzle cache. - $('li:not(.admin-menu-action, .admin-menu-action li) > a').filter(':containsi("' + event.target.value + '")', $adminMenu).each(function () { + $('li:not(.admin-menu-action, .admin-menu-action li) > a', $adminMenu).filter(':containsi("' + event.target.value + '")', $adminMenu).each(function () { var $match = $(this); var $parent = $match.parent(); var result = $match.text(); // Add the top-level category to the result. - var $category = $('#admin-menu-wrapper > ul > li').has(this); + var $category = $('#admin-menu-wrapper > ul > li', $adminMenu).has(this); if ($category.length) { result = $category.children('a').text() + ': ' + result; } - $('
  • ' + result +'
  • ').appendTo($results).hover(function () { - $parent.addClass('highlight'); - $match.trigger('mouseenter'); - }, function () { - $parent.removeClass('highlight'); - $match.trigger('mouseleave'); - }); + $('
  • ' + result + '
  • ') + .appendTo($results) + .hover(function () { + $parent.addClass('highlight'); + $match.trigger('mouseenter'); + }, function () { + $parent.removeClass('highlight'); + $match.trigger('mouseleave'); + }); }); // Show the search results. // @todo Why do they appear without this? -- 1.7.6.msysgit.0