mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 10:55:00 +08:00
Check if hosted fields instance exist before setting attribute
This commit is contained in:
parent
0781fb31d3
commit
909699886c
1 changed files with 28 additions and 24 deletions
|
@ -143,6 +143,7 @@ class CreditCardRenderer {
|
||||||
}
|
}
|
||||||
|
|
||||||
disableFields() {
|
disableFields() {
|
||||||
|
if( this.currentHostedFieldsInstance) {
|
||||||
this.currentHostedFieldsInstance.setAttribute({
|
this.currentHostedFieldsInstance.setAttribute({
|
||||||
field: 'number',
|
field: 'number',
|
||||||
attribute: 'disabled'
|
attribute: 'disabled'
|
||||||
|
@ -156,8 +157,10 @@ class CreditCardRenderer {
|
||||||
attribute: 'disabled'
|
attribute: 'disabled'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
enableFields() {
|
enableFields() {
|
||||||
|
if( this.currentHostedFieldsInstance) {
|
||||||
this.currentHostedFieldsInstance.removeAttribute({
|
this.currentHostedFieldsInstance.removeAttribute({
|
||||||
field: 'number',
|
field: 'number',
|
||||||
attribute: 'disabled'
|
attribute: 'disabled'
|
||||||
|
@ -171,6 +174,7 @@ class CreditCardRenderer {
|
||||||
attribute: 'disabled'
|
attribute: 'disabled'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_submit(contextConfig) {
|
_submit(contextConfig) {
|
||||||
this.spinner.block();
|
this.spinner.block();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue