MediaWiki:Common.js: Difference between revisions

Fixed; extra calls were disabling the fields unnecessarily.
(Undo revision 64912 by Tech (talk) Script itself is bugged; will need to fix before adding)
(Fixed; extra calls were disabling the fields unnecessarily.)
Line 699: Line 699:
  }
  }


});
// Script to disable the source fields of the new article assistant if they are not needed.
$(document).ready(function() {
$('#bnSourcetype').change(function() {
const $sourceType = $(this).val();
if ($sourceType === 'exclusive' || $sourceType === 'none') {
$('#bnSourcename').attr('disabled', true).closest('tr').fadeTo('fast', 0.5);
$('#bnSourcelink').attr('disabled', true).closest('tr').fadeTo('fast', 0.5);
} else {
$('#bnSourcename').removeAttr('disabled').closest('tr').fadeTo('fast', 1.0);
$('#bnSourcelink').removeAttr('disabled').closest('tr').fadeTo('fast', 1.0);
}
});
});
});


/* </pre> */
/* </pre> */