Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add keyboard support for dropdown menus.

  • Loading branch information...
commit dfa4ddef767ee38c6ad7721cac962d2bd1f368d0 1 parent 72eef0b
@markstory markstory authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 themes/cakephp/static/app.js
View
9 themes/cakephp/static/app.js
@@ -29,6 +29,15 @@ App.Book = (function() {
animation: 'fade'
});
});
+
+ // Make dropdowns work with keyboard input.
+ var dropdown = $('.dropdown');
+ dropdown.find('> a').bind('focus', function () {
+ $(this).parents('.dropdown').find('ul').show();
+ });
+ dropdown.find('li:last-child a').bind('blur', function () {
+ $(this).parents('.dropdown').find('ul').css('display', '');
+ });
}
function compare_scores(a, b) {
Please sign in to comment.
Something went wrong with that request. Please try again.