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) {
layout = newLayout;
if (layout == 'grid')
showImage = true;
if (layout == 'list' || layout == 'cloud')
showImage = false;
if (layout == 'grid' && appendChildTerms == true) {
appendChildTerms = false;
}
setAttributes({
layout: layout,
showImage: showImage
appendChildTerms: appendChildTerms
});
updateContent();
}
@ -675,7 +673,7 @@ registerBlockType('tainacan/facets-list', {
</Button>
</BaseControl>
{ parentTerm !== null ?
{ parentTerm !== null && layout !== 'grid' && layout !== undefined ?
<ToggleControl
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')}