mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
phpcs
This commit is contained in:
parent
7fd57b9393
commit
005a55c213
62 changed files with 905 additions and 751 deletions
|
@ -1,21 +1,25 @@
|
|||
class ErrorHandler {
|
||||
|
||||
constructor() {
|
||||
constructor()
|
||||
{
|
||||
this.wrapper = document.querySelector('.woocommerce-notices-wrapper');
|
||||
}
|
||||
|
||||
message(text) {
|
||||
message(text)
|
||||
{
|
||||
this.wrapper.classList.add('woocommerce-error');
|
||||
this.wrapper.innerText = this.sanitize(text);
|
||||
}
|
||||
|
||||
sanitize(text) {
|
||||
sanitize(text)
|
||||
{
|
||||
const textarea = document.createElement('textarea');
|
||||
textarea.innerHTML = text;
|
||||
return textarea.value;
|
||||
}
|
||||
|
||||
clear() {
|
||||
clear()
|
||||
{
|
||||
if (! this.wrapper.classList.contains('woocommerce-error')) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue