mediawiki.util: Insert node before updating tooltip for accesskey
authorFomafix <fomafix@googlemail.com>
Sun, 13 Jul 2014 14:59:10 +0000 (14:59 +0000)
committerTimo Tijhof <krinklemail@gmail.com>
Wed, 1 Oct 2014 23:22:14 +0000 (16:22 -0700)
updateTooltipAccessKeys() uses the native accessKeyLabel property which,
in Firefox, isn't available until after the node is inserted into the
document.

Bug: 67946
Change-Id: I3b80174e2f5df1c9082d30607dbe9b63ede6b5b5

resources/src/mediawiki/mediawiki.util.js

index fe5f2b2..3a06a02 100644 (file)
                        }
 
                        if ( tooltip ) {
                        }
 
                        if ( tooltip ) {
-                               $link.attr( 'title', tooltip ).updateTooltipAccessKeys();
+                               $link.attr( 'title', tooltip );
                        }
 
                        if ( nextnode ) {
                        }
 
                        if ( nextnode ) {
                                $ul.append( $item );
                        }
 
                                $ul.append( $item );
                        }
 
+                       // Update tooltip for the access key after inserting into DOM
+                       // to get a localized access key label (bug 67946).
+                       $link.updateTooltipAccessKeys();
+
                        return $item[0];
                },
 
                        return $item[0];
                },