mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-03 08:37:53 +08:00
Refactor DisplayManager for admin field display rules centralization.
This commit is contained in:
parent
93f7e5dca6
commit
e31e09f0c7
20 changed files with 619 additions and 273 deletions
13
modules/ppcp-wc-gateway/resources/js/helper/form.js
Normal file
13
modules/ppcp-wc-gateway/resources/js/helper/form.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
export const inputValue = (element) => {
|
||||
const $el = jQuery(element);
|
||||
|
||||
if ($el.is(':checkbox') || $el.is(':radio')) {
|
||||
if ($el.is(':checked')) {
|
||||
return $el.val();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return $el.val();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue