Skip to content

Commit

Permalink
fix variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
Barny-Thorpe committed Mar 26, 2024
1 parent 56e5cfa commit f868528
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions public/js/gf-giftaid-field-frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ function initGiftAid() {
/**
* Gets the selector of the total field, selected in the gift aid field settings.
* Will be in the format 'field_<form_id>_<field_id>' and will be an id so the selector will be prefixed by #.
* @param {HTMLElement} gravityForm The form element.
* @param {string} fallback fallback selector if the field is not found.
* @returns {string} The class of the total field.
*/
Expand Down Expand Up @@ -66,18 +67,19 @@ function getTotalAmount(elem, totalSelector) {

/**
* Updates the gift aid display.
* @param {HTMLElement} gravityForm The form element.
* @param {object} The donation and gift aid total.
* @returns {void}
*/
function updateGiftAidDisplay(gravityform, total) {
if (!total || !total.donation || !total.giftAidTotal) {
return;
}
const spanTotal = gravityForm.querySelector('.gform_donation_total');
const spanTotal = gravityform.querySelector('.gform_donation_total');
if (! (spanTotal instanceof HTMLSpanElement)) {
return;
}
const spanTotalGift = gravityForm.querySelector('.gform_donation_gifttotal');
const spanTotalGift = gravityform.querySelector('.gform_donation_gifttotal');
if (! (spanTotalGift instanceof HTMLSpanElement)) {
return;
}
Expand Down

0 comments on commit f868528

Please sign in to comment.