mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 09:08:09 +08:00
add semicolons
This commit is contained in:
parent
2a099b0634
commit
7521e63ef4
2 changed files with 23 additions and 24 deletions
|
@ -1,5 +1,5 @@
|
|||
function onboardingCallback(authCode, sharedId) {
|
||||
const sandboxSwitchElement = document.querySelector('#ppcp-sandbox_on')
|
||||
const sandboxSwitchElement = document.querySelector('#ppcp-sandbox_on');
|
||||
fetch(
|
||||
PayPalCommerceGatewayOnboarding.endpoint,
|
||||
{
|
||||
|
@ -47,7 +47,7 @@ const checkBoxOnClick = (event) => {
|
|||
event.target.checked = value;
|
||||
},1
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Toggles the credential input fields.
|
||||
|
@ -75,7 +75,7 @@ const credentialToggle = (forProduction) => {
|
|||
document.querySelectorAll(selectors.join()).forEach(
|
||||
(element) => {element.classList.toggle('show')}
|
||||
)
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Toggles the visibility of the sandbox/production input fields.
|
||||
|
@ -112,38 +112,38 @@ const toggleSandboxProduction = (showProduction) => {
|
|||
if (showProduction) {
|
||||
document.querySelectorAll(productionDisplaySelectors.join()).forEach(
|
||||
(element) => {element.style.display = ''}
|
||||
)
|
||||
);
|
||||
document.querySelectorAll(sandboxDisplaySelectors.join()).forEach(
|
||||
(element) => {element.style.display = 'none'}
|
||||
)
|
||||
);
|
||||
document.querySelectorAll(productionClassSelectors.join()).forEach(
|
||||
(element) => {element.classList.remove('hide')}
|
||||
)
|
||||
);
|
||||
document.querySelectorAll(sandboxClassSelectors.join()).forEach(
|
||||
(element) => {
|
||||
element.classList.remove('show')
|
||||
element.classList.add('hide')
|
||||
element.classList.remove('show');
|
||||
element.classList.add('hide');
|
||||
}
|
||||
)
|
||||
);
|
||||
return;
|
||||
}
|
||||
document.querySelectorAll(productionDisplaySelectors.join()).forEach(
|
||||
(element) => {element.style.display = 'none'}
|
||||
)
|
||||
);
|
||||
document.querySelectorAll(sandboxDisplaySelectors.join()).forEach(
|
||||
(element) => {element.style.display = ''}
|
||||
)
|
||||
);
|
||||
|
||||
document.querySelectorAll(sandboxClassSelectors.join()).forEach(
|
||||
(element) => {element.classList.remove('hide')}
|
||||
)
|
||||
);
|
||||
document.querySelectorAll(productionClassSelectors.join()).forEach(
|
||||
(element) => {
|
||||
element.classList.remove('show')
|
||||
element.classList.add('hide')
|
||||
element.classList.remove('show');
|
||||
element.classList.add('hide');
|
||||
}
|
||||
)
|
||||
}
|
||||
};
|
||||
|
||||
const disconnect = (event) => {
|
||||
event.preventDefault();
|
||||
|
@ -166,7 +166,7 @@ const disconnect = (event) => {
|
|||
);
|
||||
|
||||
document.querySelector('.woocommerce-save-button').click();
|
||||
}
|
||||
};
|
||||
|
||||
(() => {
|
||||
const sandboxSwitchElement = document.querySelector('#ppcp-sandbox_on');
|
||||
|
|
|
@ -15,7 +15,7 @@ const groupToggle = (selector, group) => {
|
|||
if (! event.target.checked) {
|
||||
group.forEach( (elementToHide) => {
|
||||
document.querySelector(elementToHide).style.display = 'none';
|
||||
})
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -24,8 +24,7 @@ const groupToggle = (selector, group) => {
|
|||
})
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
const groupToggleSelect = (selector, group) => {
|
||||
const toggleElement = document.querySelector(selector);
|
||||
|
@ -43,7 +42,7 @@ const groupToggleSelect = (selector, group) => {
|
|||
return;
|
||||
}
|
||||
domElement.style.display = 'none';
|
||||
})
|
||||
});
|
||||
toggleElement.addEventListener(
|
||||
'change',
|
||||
(event) => {
|
||||
|
@ -57,7 +56,7 @@ const groupToggleSelect = (selector, group) => {
|
|||
})
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
const disableOptions = (sourceSelector, targetSelector) => {
|
||||
|
||||
|
@ -87,11 +86,11 @@ const disableOptions = (sourceSelector, targetSelector) => {
|
|||
target.append(option);
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
source.on('change',replace);
|
||||
replace();
|
||||
}
|
||||
};
|
||||
|
||||
(() => {
|
||||
disableOptions('select[name="ppcp[disable_cards][]"]', 'select[name="ppcp[card_icons][]"]');
|
||||
|
@ -258,4 +257,4 @@ const disableOptions = (sourceSelector, targetSelector) => {
|
|||
}
|
||||
]
|
||||
);
|
||||
})()
|
||||
})();
|
Loading…
Add table
Add a link
Reference in a new issue