mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-03 08:37:53 +08:00
Do not render messages when buttons are not rendered.
This commit is contained in:
parent
77230fefa8
commit
6effc222f2
2 changed files with 11 additions and 0 deletions
|
@ -14,6 +14,7 @@ class SingleProductBootstap {
|
|||
if (!this.shouldRender()) {
|
||||
this.renderer.hideButtons(this.gateway.hosted_fields.wrapper);
|
||||
this.renderer.hideButtons(this.gateway.button.wrapper);
|
||||
this.messages.hideMessages();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -26,6 +27,7 @@ class SingleProductBootstap {
|
|||
|
||||
if (!this.shouldRender()) {
|
||||
this.renderer.hideButtons(this.gateway.hosted_fields.wrapper);
|
||||
this.messages.hideMessages();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -53,5 +53,14 @@ class MessageRenderer {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
hideMessages() {
|
||||
const domElement = document.querySelector(this.config.wrapper);
|
||||
if (! domElement ) {
|
||||
return false;
|
||||
}
|
||||
domElement.style.display = 'none';
|
||||
return true;
|
||||
}
|
||||
}
|
||||
export default MessageRenderer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue