PluginProbe
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce / 3.3.0
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce v3.3.0
3.3.0 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.1 trunk 1.0.4 1.1.0 1.1.0.1 1.1.1 1.1.10 1.1.11 1.1.12 1.1.13 1.1.14 1.1.15 1.1.16 1.1.17 1.1.18 1.1.19 1.1.2 All 162 releases
cartflows / modules / gutenberg / src / controls / getAttributeFallback.js

getAttributeFallback.js in CartFlows – Funnel Builder & Checkout Plugin for WooCommerce 3.3.0, at modules/gutenberg/src/controls/getAttributeFallback.js

17 lines 630 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { blocksAttributes } from '@Attributes/getBlocksDefaultAttributes';
2
3 // Parameters for these methods:
4 // currentValue - The variable/attribute that is altered by settings.
5 // key - The key of the default attribute for that setting.
6 // blockName - The name of the block.
7
8 const getAttributeFallback = ( currentValue, key, blockName ) =>
9 currentValue ? currentValue : blocksAttributes[ blockName ][ key ].default;
10
11 export const getFallbackNumber = ( currentValue, key, blockName ) =>
12 isNaN( currentValue )
13 ? blocksAttributes[ blockName ][ key ].default
14 : currentValue;
15
16 export default getAttributeFallback;
17