From: Marius Hoch Date: Sat, 7 Sep 2013 12:46:35 +0000 (+0200) Subject: Allow toggling elements with space X-Git-Tag: 1.31.0-rc.0~18792 X-Git-Url: http://git.cyclocoop.org/%22.htmlspecialchars%28%24url_syndic%29.%22?a=commitdiff_plain;h=078276356be07b35040973ef34e653ee67e739e7;p=lhc%2Fweb%2Fwiklou.git Allow toggling elements with space This seems more convenient than having the space key do nothing as it does right now. Furthermore this is more consistent with the various other collapsible things we have around than to just scroll the page on a space keypress. Bug: 53797 Change-Id: If9292ef6a8fd82b097c597dc166e38c8ca31f4ff --- diff --git a/resources/jquery/jquery.makeCollapsible.js b/resources/jquery/jquery.makeCollapsible.js index ac46092bf1..27c4c6cc4d 100644 --- a/resources/jquery/jquery.makeCollapsible.js +++ b/resources/jquery/jquery.makeCollapsible.js @@ -163,8 +163,8 @@ if ( e.type === 'click' && options.linksPassthru && $.nodeName( e.target, 'a' ) ) { // Don't fire if a link was clicked, if requested (for premade togglers by default) return; - } else if ( e.type === 'keypress' && e.which !== 13 ) { - // Only handle keypresses on the "Enter" key + } else if ( e.type === 'keypress' && e.which !== 13 && e.which !== 32 ) { + // Only handle keypresses on the "Enter" or "Space" keys return; } else { e.preventDefault();