Fix TypeError: trigger.attr is not a function

Code was assuming jQuery.Object when it is now an Element.

Bug: T335148
Change-Id: I4755607f991889468294e022015a6a7e4becbb6c
This commit is contained in:
Nicholas Ray 2023-04-20 13:05:21 -06:00
parent e0e118bb00
commit c61d57c72a

View file

@ -560,7 +560,7 @@ function initStickyHeader( props ) {
// Make sure ULS outside sticky header disables the sticky header behaviour.
mw.hook( 'mw.uls.compact_language_links.open' ).add( function ( $trigger ) {
const trigger = $trigger[ 0 ];
if ( trigger.attr( 'id' ) !== 'p-lang-btn-sticky-header' ) {
if ( trigger.id !== 'p-lang-btn-sticky-header' ) {
const bodyClassList = document.body.classList;
bodyClassList.remove( ULS_HIDE_CLASS );
bodyClassList.remove( ULS_STICKY_CLASS );