Merge "Fix linter warnings"

This commit is contained in:
jenkins-bot 2024-09-27 16:16:03 +00:00 committed by Gerrit Code Review
commit 72118a48b6
2 changed files with 15 additions and 5 deletions

View file

@ -233,7 +233,9 @@ function makeFeedbackLink( betaMessageElement ) {
* @param {Record<string,ClientPreference>} config
* @param {UserPreferencesApi} userPreferences
*/
function appendToggleSwitch( form, featureName, labelElement, currentValue, config, userPreferences ) {
function appendToggleSwitch(
form, featureName, labelElement, currentValue, config, userPreferences
) {
const input = makeInputElement( 'checkbox', featureName, currentValue );
input.classList.add( 'cdx-toggle-switch__input' );
const switcher = document.createElement( 'span' );
@ -300,13 +302,17 @@ function makeControl( featureName, config, userPreferences ) {
switch ( type ) {
case 'radio':
pref.options.forEach( ( value ) => {
appendRadioToggle( form, featureName, value, String( currentValue ), config, userPreferences );
appendRadioToggle(
form, featureName, value, String( currentValue ), config, userPreferences
);
} );
break;
case 'switch': {
const labelElement = document.createElement( 'label' );
labelElement.textContent = getFeatureLabelMsg( featureName ).text();
appendToggleSwitch( form, featureName, labelElement, String( currentValue ), config, userPreferences );
appendToggleSwitch(
form, featureName, labelElement, String( currentValue ), config, userPreferences
);
break;
} default:
throw new Error( 'Unknown client preference! Only switch or radio are supported.' );

View file

@ -91,11 +91,15 @@ function main( window ) {
// disable our night mode if so
if ( isNightModeGadgetEnabled() ) {
disableNightModeForGadget();
clientPreferences.render( appearanceMenuSelector, clientPreferenceConfig, userPreferences );
clientPreferences.render(
appearanceMenuSelector, clientPreferenceConfig, userPreferences
);
alterExclusionMessage();
removeBetaNotice();
} else {
clientPreferences.render( appearanceMenuSelector, clientPreferenceConfig, userPreferences );
clientPreferences.render(
appearanceMenuSelector, clientPreferenceConfig, userPreferences
);
}
} );
}