mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 13:44:42 +08:00
Disable via CSS class
This commit is contained in:
parent
a2f61e9505
commit
50ca4dc079
3 changed files with 16 additions and 18 deletions
|
@ -1,3 +1,9 @@
|
||||||
#place_order.ppcp-hidden {
|
#place_order.ppcp-hidden {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ppcp-disabled {
|
||||||
|
cursor: not-allowed;
|
||||||
|
-webkit-filter: grayscale(100%);
|
||||||
|
filter: grayscale(100%);
|
||||||
|
}
|
||||||
|
|
|
@ -17,20 +17,14 @@ export const setEnabled = (selectorOrElement, enable, form = null) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enable) {
|
if (enable) {
|
||||||
jQuery(element).css({
|
jQuery(element)
|
||||||
'cursor': '',
|
.removeClass('ppcp-disabled')
|
||||||
'-webkit-filter': '',
|
|
||||||
'filter': '',
|
|
||||||
} )
|
|
||||||
.off('mouseup')
|
.off('mouseup')
|
||||||
.find('> *')
|
.find('> *')
|
||||||
.css('pointer-events', '');
|
.css('pointer-events', '');
|
||||||
} else {
|
} else {
|
||||||
jQuery(element).css({
|
jQuery(element)
|
||||||
'cursor': 'not-allowed',
|
.addClass('ppcp-disabled')
|
||||||
'-webkit-filter': 'grayscale(100%)',
|
|
||||||
'filter': 'grayscale(100%)',
|
|
||||||
})
|
|
||||||
.on('mouseup', function(event) {
|
.on('mouseup', function(event) {
|
||||||
event.stopImmediatePropagation();
|
event.stopImmediatePropagation();
|
||||||
|
|
||||||
|
|
|
@ -591,14 +591,12 @@ class SmartButton implements SmartButtonInterface {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( in_array( $this->context(), array( 'pay-now', 'checkout' ), true ) ) {
|
|
||||||
wp_enqueue_style(
|
wp_enqueue_style(
|
||||||
'gateway',
|
'gateway',
|
||||||
untrailingslashit( $this->module_url ) . '/assets/css/gateway.css',
|
untrailingslashit( $this->module_url ) . '/assets/css/gateway.css',
|
||||||
array(),
|
array(),
|
||||||
$this->version
|
$this->version
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
wp_enqueue_script(
|
wp_enqueue_script(
|
||||||
'ppcp-smart-button',
|
'ppcp-smart-button',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue