Remove unused

This commit is contained in:
Alex P 2022-01-12 09:34:12 +02:00
parent be389d4044
commit 39367e7b51

View file

@ -101,27 +101,6 @@ function ppcp_onboarding_productionCallback(...args) {
return ppcp_onboarding.loginSeller('production', ...args);
}
/**
* Since the PayPal modal will redirect the user a dirty form
* provokes an alert if the user wants to leave the page. Since the user
* needs to toggle the sandbox switch, we disable this dirty state with the
* following workaround for checkboxes.
*
* @param event
*/
const checkBoxOnClick = (event) => {
const value = event.target.checked;
if (event.target.getAttribute('id') === 'ppcp-sandbox_on') {
toggleSandboxProduction(! value);
}
event.preventDefault();
event.stopPropagation();
setTimeout( () => {
event.target.checked = value;
},1
);
};
/**
* Toggles the credential input fields.
*
@ -274,12 +253,6 @@ const disconnect = (event) => {
);
}
// document.querySelectorAll('#mainform input[type="checkbox"]').forEach(
// (checkbox) => {
// checkbox.addEventListener('click', checkBoxOnClick);
// }
// );
document.querySelectorAll('#field-sandbox_toggle_manual_input button, #field-production_toggle_manual_input button').forEach(
(button) => {
button.addEventListener(