Disable via CSS class

This commit is contained in:
Alex P 2023-09-11 10:47:08 +03:00
parent a2f61e9505
commit 50ca4dc079
No known key found for this signature in database
GPG key ID: 54487A734A204D71
3 changed files with 16 additions and 18 deletions

View file

@ -1,3 +1,9 @@
#place_order.ppcp-hidden {
display: none !important;
}
.ppcp-disabled {
cursor: not-allowed;
-webkit-filter: grayscale(100%);
filter: grayscale(100%);
}

View file

@ -17,20 +17,14 @@ export const setEnabled = (selectorOrElement, enable, form = null) => {
}
if (enable) {
jQuery(element).css({
'cursor': '',
'-webkit-filter': '',
'filter': '',
} )
jQuery(element)
.removeClass('ppcp-disabled')
.off('mouseup')
.find('> *')
.css('pointer-events', '');
} else {
jQuery(element).css({
'cursor': 'not-allowed',
'-webkit-filter': 'grayscale(100%)',
'filter': 'grayscale(100%)',
})
jQuery(element)
.addClass('ppcp-disabled')
.on('mouseup', function(event) {
event.stopImmediatePropagation();

View file

@ -591,14 +591,12 @@ class SmartButton implements SmartButtonInterface {
);
}
if ( in_array( $this->context(), array( 'pay-now', 'checkout' ), true ) ) {
wp_enqueue_style(
'gateway',
untrailingslashit( $this->module_url ) . '/assets/css/gateway.css',
array(),
$this->version
);
}
wp_enqueue_script(
'ppcp-smart-button',