Skip to content

Commit

Permalink
Merge pull request #1872 from Automattic/fix/free-trial-checkout-load…
Browse files Browse the repository at this point in the history
…ing-issue

fix (ras-acc): make processing class unique to avoid clashes
  • Loading branch information
laurelfulford authored Sep 5, 2024
2 parents 9af74b5 + 4262da5 commit 75290f0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/modal-checkout/checkout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
// Processing styles
.modal_checkout_nyp,
.modal_checkout_coupon {
&.processing {
&.modal-processing {
opacity: 0.5;
}
}
Expand Down Expand Up @@ -558,7 +558,7 @@
margin-top: 0;
}

.processing {
.modal-processing {
opacity: 0.5;
}
}
8 changes: 4 additions & 4 deletions src/modal-checkout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,14 +630,14 @@ domReady(
* @return {boolean} Whether the form was blocked or not.
*/
function blockForm( form ) {
if ( form.is( '.processing' ) ) {
if ( form.is( '.modal-processing' ) ) {
return false;
}
const buttons = form.find( 'button[type=submit]' );
buttons.each( ( i, el ) => {
$( el ).attr( 'disabled', true );
} );
form.addClass( 'processing' );
form.addClass( 'modal-processing' );
return true;
}

Expand All @@ -649,14 +649,14 @@ domReady(
* @return {boolean} Whether the form was unblocked or not.
*/
function unblockForm( form ) {
if ( ! form.is( '.processing' ) ) {
if ( ! form.is( '.modal-processing' ) ) {
return false;
}
const buttons = form.find( 'button[type=submit]' );
buttons.each( ( i, el ) => {
$( el ).attr( 'disabled', false );
} );
form.removeClass( 'processing' );
form.removeClass( 'modal-processing' );
return true;
}
} );
Expand Down
6 changes: 3 additions & 3 deletions src/modal-checkout/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ domReady( () => {
form.appendChild( modalCheckoutHiddenInput.cloneNode() );
form.target = IFRAME_NAME;
form.addEventListener( 'submit', ev => {
form.classList.add( 'processing' );
form.classList.add( 'modal-processing' );

const productData = form.dataset.product;
if ( productData ) {
Expand Down Expand Up @@ -288,14 +288,14 @@ domReady( () => {

// Open the variations modal.
ev.preventDefault();
form.classList.remove( 'processing' );
form.classList.remove( 'modal-processing' );
openModal( variationModal );
a11y.trapFocus( variationModal, false );
return;
}
}

form.classList.remove( 'processing' );
form.classList.remove( 'modal-processing' );

// Set reader activation checkout data if available.
let data = {};
Expand Down
2 changes: 1 addition & 1 deletion src/modal-checkout/modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,6 @@
}
}

.processing {
.modal-processing {
opacity: 0.5;
}

0 comments on commit 75290f0

Please sign in to comment.