Merge "jquery.makeCollapsible: Togglers accessibility"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 9 Jul 2013 00:44:12 +0000 (00:44 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 9 Jul 2013 00:44:12 +0000 (00:44 +0000)
resources/jquery/jquery.makeCollapsible.js

index 2823174..3a6c1b1 100644 (file)
                                }
                        }
 
+                       // Attributes for accessibility. This isn't necessary when the toggler is already
+                       // an <a> or a <button> etc., but it doesn't hurt either, and it's consistent.
+                       $toggleLink.prop( 'tabIndex', 0 ).attr( 'role', 'button' );
+
                        // Initial state
                        if ( options.collapsed || $collapsible.hasClass( 'mw-collapsed' ) ) {
                                // Remove here so that the toggler goes in the right direction (the class is re-added)