Disables append child option for grid layout (for now).

This commit is contained in:
mateuswetah 2020-11-27 11:54:11 -03:00
parent 108d025c33
commit 5dc40ba02d
1 changed files with 5 additions and 7 deletions

View File

@ -477,15 +477,13 @@ registerBlockType('tainacan/facets-list', {
function updateLayout(newLayout) { function updateLayout(newLayout) {
layout = newLayout; layout = newLayout;
if (layout == 'grid') if (layout == 'grid' && appendChildTerms == true) {
showImage = true; appendChildTerms = false;
}
if (layout == 'list' || layout == 'cloud')
showImage = false;
setAttributes({ setAttributes({
layout: layout, layout: layout,
showImage: showImage appendChildTerms: appendChildTerms
}); });
updateContent(); updateContent();
} }
@ -675,7 +673,7 @@ registerBlockType('tainacan/facets-list', {
</Button> </Button>
</BaseControl> </BaseControl>
{ parentTerm !== null ? { parentTerm !== null && layout !== 'grid' && layout !== undefined ?
<ToggleControl <ToggleControl
label={__('Append child terms', 'tainacan')} label={__('Append child terms', 'tainacan')}
help={ appendChildTerms ? __("Do not append child terms after each term found", 'tainacan') : __("Toggle to append child terms after each term found", 'tainacan')} help={ appendChildTerms ? __("Do not append child terms after each term found", 'tainacan') : __("Toggle to append child terms after each term found", 'tainacan')}