Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix (ras-acc): make processing class unique to avoid clashes #1872

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -635,14 +635,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 @@ -654,14 +654,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;
}