Fix InvalidCharacterError: Failed to execute 'add' on 'DOMTokenList'

Bug: T335149
Change-Id: I9dad78af21ca7ee272a3661f5869e6337909dc05
This commit is contained in:
Nicholas Ray 2023-04-20 13:44:36 -06:00
parent c61d57c72a
commit 630d47792a

View file

@ -11,16 +11,16 @@ function init() {
const element = badge.$element[ 0 ];
element.classList.add( 'mw-list-item' );
const iconButtonClasses = 'mw-ui-button mw-ui-quiet mw-ui-icon mw-ui-icon-element ';
const iconButtonClasses = [ 'mw-ui-button', 'mw-ui-quiet', 'mw-ui-icon', 'mw-ui-icon-element' ];
if ( element.id === 'pt-notifications-alert' ) {
const anchor = element.querySelector( 'a' );
anchor.classList.add( iconButtonClasses + 'mw-ui-icon-bell' );
anchor.classList.add( ...iconButtonClasses, 'mw-ui-icon-bell' );
anchor.classList.remove( 'oo-ui-icon-bell' );
}
if ( element.id === 'pt-notifications-notice' ) {
const anchor = element.querySelector( 'a' );
anchor.classList.add( iconButtonClasses + 'mw-ui-icon-tray' );
anchor.classList.add( ...iconButtonClasses, 'mw-ui-icon-tray' );
anchor.classList.remove( 'oo-ui-icon-tray' );
}
} );