mediawiki.util: Only call $.fn.updateTooltipAccessKeys if accesskey is set
authorTimo Tijhof <krinklemail@gmail.com>
Fri, 17 Aug 2018 17:23:00 +0000 (18:23 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Fri, 17 Aug 2018 17:25:04 +0000 (18:25 +0100)
Avoids overhead of mw.Message#parse, jqueryMsg.parser, and various
other DOM operations.

Bug: T202151
Change-Id: Id6304c9223806af6d469d9b4c67e60263f4b17ac

resources/src/mediawiki.util.js

index 9eea6f3..ca0c303 100644 (file)
 
                        // Update tooltip for the access key after inserting into DOM
                        // to get a localized access key label (T69946).
-                       $link.updateTooltipAccessKeys();
+                       if ( accesskey ) {
+                               $link.updateTooltipAccessKeys();
+                       }
 
                        return $item[ 0 ];
                },