mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-24 07:43:47 +00:00
Merge "languageButton: Use click method instead of dispatchEvent"
This commit is contained in:
commit
aec05c9a37
|
@ -5,7 +5,9 @@
|
||||||
* has been released and contains this
|
* has been released and contains this
|
||||||
*/
|
*/
|
||||||
function addInterwikiLinkToMainMenu() {
|
function addInterwikiLinkToMainMenu() {
|
||||||
const editLink = document.querySelector( '#p-lang-btn .wbc-editpage' );
|
const editLink = /** @type {HTMLElement|null} */ (
|
||||||
|
document.querySelector( '#p-lang-btn .wbc-editpage' )
|
||||||
|
);
|
||||||
|
|
||||||
if ( !editLink ) {
|
if ( !editLink ) {
|
||||||
return;
|
return;
|
||||||
|
@ -26,7 +28,7 @@ function addInterwikiLinkToMainMenu() {
|
||||||
addInterlanguageLink.addEventListener( 'click', function ( /** @type {Event} */ e ) {
|
addInterlanguageLink.addEventListener( 'click', function ( /** @type {Event} */ e ) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
// redirect to the detached and original edit link
|
// redirect to the detached and original edit link
|
||||||
editLink.dispatchEvent( new Event( 'click' ) );
|
editLink.click();
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue