Permalink
Browse files

Improve Enter key behavior in Opera

  • Loading branch information...
mathiasbynens committed Mar 15, 2012
1 parent 6109113 commit 541097e13a251c4d652010fd3842c75886eae980
Showing with 4 additions and 4 deletions.
  1. +2 −2 jquery.details.js
  2. +2 −2 jquery.details.min.js
View
@@ -1,4 +1,4 @@
-/*! http://mths.be/details v0.0.5 by @mathias | includes http://mths.be/noselect v1.0.3 */
+/*! http://mths.be/details v0.0.6 by @mathias | includes http://mths.be/noselect v1.0.3 */
;(function(document, $) {
var proto = $.fn,
@@ -131,7 +131,7 @@
// Toggle the `open` and `aria-expanded` attributes and the `open` property of the `details` element and display the additional info
toggleOpen($details, $detailsSummary, $detailsNotSummary, true);
}).keyup(function(event) {
- if (32 == event.keyCode && !isOpera || 13 == event.keyCode) {
+ if (32 == event.keyCode || (13 == event.keyCode && !isOpera)) {
// Space or Enter is pressed — trigger the `click` event on the `summary` element
// Opera already seems to trigger the `click` event when Enter is pressed
event.preventDefault();
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 541097e

Please sign in to comment.