Skip to content

Commit

Permalink
refs #40071. Correct scroll position in mobile contribution process
Browse files Browse the repository at this point in the history
  • Loading branch information
poliphilochu committed Apr 26, 2024
1 parent 0cebf63 commit b37b3f4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions js/contribution_page.d9.js
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@
if(this.currentFormStep == 1 && step == 2){
// Check instrument is credit card
var error_msg = [];
console.log(this.currentPriceAmount);
//console.log(this.currentPriceAmount);
if(!this.currentPriceAmount || this.currentPriceAmount == 0){
error_msg.push('Please enter a valid amount.');
}
Expand Down Expand Up @@ -644,6 +644,9 @@

updateFormStep: function(isScrollAnimate) {
var currentStepClassName = 'contrib-step-'+this.currentFormStep;
var $rightCol = $('#main-inner').length ? $('#main-inner') : $('#main .row-offcanvas');
var $stepInfo = $('.custom-step-info');

$('[class*=contrib-step-]').each(function(){
var $this = $(this);
/**
Expand Down Expand Up @@ -681,7 +684,7 @@
});

if (isScrollAnimate) {
var topPosition = $('#content-main').offset().top - 30;
var topPosition = $rightCol.offset().top - $stepInfo.height();
$('html,body').animate({ scrollTop: topPosition }, 500);
}

Expand Down

0 comments on commit b37b3f4

Please sign in to comment.