mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 12:25:15 +08:00
enable errors to persist even if a general error is incoming
This commit is contained in:
parent
103faec26d
commit
deffc2d0e8
1 changed files with 9 additions and 1 deletions
|
@ -7,13 +7,21 @@ class ErrorHandler {
|
|||
}
|
||||
|
||||
genericError() {
|
||||
if (this.wrapper.classList.contains('ppcp-persist')) {
|
||||
return;
|
||||
}
|
||||
this.clear();
|
||||
this.message(this.genericErrorText)
|
||||
}
|
||||
|
||||
message(text)
|
||||
message(text, persist = false)
|
||||
{
|
||||
this.wrapper.classList.add('woocommerce-error');
|
||||
if (persist) {
|
||||
this.wrapper.classList.add('ppcp-persist');
|
||||
} else {
|
||||
this.wrapper.classList.remove('ppcp-persist');
|
||||
}
|
||||
this.wrapper.innerText = this.sanitize(text);
|
||||
jQuery.scroll_to_notices(jQuery('.woocommerce-notices-wrapper'))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue