MediaWiki:DonationForm.js: Difference between revisions
Jump to navigation
Jump to search
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: | Line 945: | ||
donationForm.updateFeeDisplay = function() { |
donationForm.updateFeeDisplay = function() { |
||
var |
var selectedAmount = 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 |
if ( feeAmount % 1 !== 0 ) { // Not a whole number |
||
feeText = feeAmount.toFixed(2); |
|||
} else { |
} else { |
||
feeText = feeAmount.toString(); |
|||
} |
|||
⚫ | |||
if ( selectedAmount + feeAmount <= maxAmount ) { |
|||
⚫ | |||
} |
} |
||
⚫ | |||
⚫ | |||
}; |
}; |
||