Skip to content

Commit

Permalink
Merge pull request #16 from ItinerisLtd/support-gw-cache-buster
Browse files Browse the repository at this point in the history
fix: support Gravity Perks Cache Buster
  • Loading branch information
codepuncher authored Nov 22, 2024
2 parents 88562ed + 0636866 commit 13b9b61
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions public/js/gf-giftaid-field-frontend.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
document.addEventListener('DOMContentLoaded', initGiftAid);
if (window.jQuery) {
window.jQuery(document).on('gform_post_render', initGiftAid);
}

/**
* Updates the gift aid display, based on a chosen field changing.
*/
function initGiftAid() {
const gravityForm = document.querySelector('.gform_wrapper');
function initGiftAid(_, form_id) {
const gravityForm = document.getElementById('gform_wrapper_' + form_id);
if (!(gravityForm instanceof HTMLElement)) {
return;
}
Expand Down

0 comments on commit 13b9b61

Please sign in to comment.