MediaWiki:DonationForm.js: Difference between revisions

Content deleted Content added
aligning amounts, mention tracking doc
modify updateFeeDisplay to not show PTF if it would take donation over max amount
Line 945:
 
donationForm.updateFeeDisplay = function() {
var feeAmountselectedAmount = donationForm.calculateFee( donationForm.getAmount() );,
feeAmount = donationForm.calculateFee( selectedAmount ),
minAmount = donationForm.minimums[ donationForm.currency ] || 1,
maxAmount = donationForm.maxUSD * minAmount,
feeText;
 
if ( feeAmount % 1 !== 0 ) { // Not a whole number
feeAmountfeeText = feeAmount.toFixed(2);
} else {
feeAmountfeeText = feeAmount.toString();
}
 
$('.ptf label span').text( feeAmountfeeText );
if ( selectedAmount + feeAmount <= maxAmount ) {
$('.ptf').slideDown();
}
$('.ptf label span').text( feeAmount );
$('.ptf').slideDown();
};