mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-23 23:33:54 +00:00
Fix linter warnings
Change-Id: I012a98cb3fcbfaa2ba40d85c0225bcf44deb5c01
This commit is contained in:
parent
15e7bf48d1
commit
dd570d7912
|
@ -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.' );
|
||||
|
|
|
@ -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
|
||||
);
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue