From 38cfcfffe92f2ac2572ab7ebc51e860de9312baf Mon Sep 17 00:00:00 2001 From: jzaefferer Date: Thu, 24 Feb 2011 12:05:20 +0100 Subject: [PATCH] Menu: Update autocomplete to use deactivate and check for focus class --- tests/unit/autocomplete/autocomplete_core.js | 2 +- tests/visual/menu/menu.html | 21 ++++++++++++++++++-- themes/base/jquery.ui.menu.css | 2 ++ ui/jquery.ui.autocomplete.js | 8 ++++---- ui/jquery.ui.menu.js | 19 +++++++++++++++++- 5 files changed, 44 insertions(+), 8 deletions(-) diff --git a/tests/unit/autocomplete/autocomplete_core.js b/tests/unit/autocomplete/autocomplete_core.js index fcd835d1a..2edb8876c 100644 --- a/tests/unit/autocomplete/autocomplete_core.js +++ b/tests/unit/autocomplete/autocomplete_core.js @@ -49,7 +49,7 @@ test( "prevent form submit on enter when menu is active", function() { event = $.Event( "keydown" ); event.keyCode = $.ui.keyCode.DOWN; ac.trigger( event ); - same( $( ".ui-menu-item:has(.ui-state-hover)" ).length, 1, "menu item is active" ); + same( $( ".ui-menu-item:has(.ui-state-focus)" ).length, 1, "menu item is active" ); event = $.Event( "keydown" ); event.keyCode = $.ui.keyCode.ENTER; diff --git a/tests/visual/menu/menu.html b/tests/visual/menu/menu.html index 395a06bdf..32fb98ea8 100644 --- a/tests/visual/menu/menu.html +++ b/tests/visual/menu/menu.html @@ -24,7 +24,7 @@ }); } - var menus = $("#menu1, #menu2"); + var menus = $("#menu1, #menu2, #menu3"); create(); $("#toggle-destroy").toggle(function() { @@ -55,7 +55,24 @@
  • Salzburg
  • -