Avoid repeated initialization when clicking very fast
There is potentially a lot of time between when the attribute is checked and when it is finally set. At least the two RessourceLoader modules need to load. This can take a while, even on fast internet connections. Just double clicking with the mouse can trigger the code twice without the attribute being set. The proposed solution is not the only one, but I believe moving this single line is the most trivial one. Bug: T358637 Change-Id: Ic9b99859841439febb83e91f70930e8676a4968a
This commit is contained in:
@@ -578,6 +578,7 @@
|
||||
if ( $target.attr( 'data-uls-loaded' ) ) {
|
||||
return;
|
||||
}
|
||||
$target.attr( 'data-uls-loaded', true );
|
||||
|
||||
ev.preventDefault();
|
||||
|
||||
@@ -588,8 +589,6 @@
|
||||
languageNodes = parent ? parent.querySelectorAll( '.interlanguage-link-target' ) : [];
|
||||
standalone = isUsingStandaloneLanguageButton();
|
||||
|
||||
$target.attr( 'data-uls-loaded', true );
|
||||
|
||||
// Setup click handler for ULS
|
||||
launchULS(
|
||||
$target,
|
||||
|
||||
Reference in New Issue
Block a user