2 * JavaScript for Special:Preferences: Email preferences better UX
6 var allowEmail
, allowEmailFromNewUsers
;
8 allowEmail
= $( '#wpAllowEmail' );
9 allowEmailFromNewUsers
= $( '#wpAllowEmailFromNewUsers' );
11 function toggleDisabled() {
12 if ( allowEmail
.is( ':checked' ) && allowEmail
.is( ':enabled' ) ) {
13 allowEmailFromNewUsers
.prop( 'disabled', false );
15 allowEmailFromNewUsers
.prop( 'disabled', true );
20 allowEmail
.on( 'change', toggleDisabled
);