Skip to content

Commit

Permalink
Implement a way of tracking which payment method hid the Save and Con…
Browse files Browse the repository at this point in the history
…tinue button, allowing other libraries to use the same method of hiding the button.
  • Loading branch information
mrbrdo committed Mar 11, 2022
1 parent 6d733b4 commit 92e5136
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ SpreePaypalExpress = {
},
hideSaveAndContinue: function() {
$("#checkout_form_payment [data-hook=buttons]").hide();
$("#checkout_form_payment").data('hidden-by-payment-method-id', SpreePaypalExpress.paymentMethodID);
},
showSaveAndContinue: function() {
$("#checkout_form_payment [data-hook=buttons]").show();
if (typeof ($("#checkout_form_payment").data('hidden-by-payment-method-id')) === 'undefined' || $("#checkout_form_payment").data('hidden-by-payment-method-id') == SpreePaypalExpress.paymentMethodID) {
$("#checkout_form_payment [data-hook=buttons]").show();
$("#checkout_form_payment").removeData('hidden-by-payment-method-id');
}
}
}

Expand Down

0 comments on commit 92e5136

Please sign in to comment.