Initialization of some variables on gutenberg blocks.

This commit is contained in:
Mateus Machado Luna 2019-08-21 10:11:52 -03:00
parent 219fcff480
commit bc1e889d43
2 changed files with 2 additions and 2 deletions

View File

@ -380,7 +380,7 @@ registerBlockType('tainacan/facets-list', {
<div>
<RangeControl
label={__('Maximum number of facets', 'tainacan')}
value={ maxFacetsNumber }
value={ maxFacetsNumber ? maxFacetsNumber : 12}
onChange={ ( aMaxFacetsNumber ) => {
maxFacetsNumber = aMaxFacetsNumber;
setAttributes( { maxFacetsNumber: aMaxFacetsNumber } )

View File

@ -428,7 +428,7 @@ registerBlockType('tainacan/dynamic-items-list', {
<div>
<RangeControl
label={__('Maximum number of items', 'tainacan')}
value={ maxItemsNumber }
value={ maxItemsNumber ? maxItemsNumber : 12 }
onChange={ ( aMaxItemsNumber ) => {
maxItemsNumber = aMaxItemsNumber;
setAttributes( { maxItemsNumber: aMaxItemsNumber } )