Disables append child option for grid layout (for now).
This commit is contained in:
parent
108d025c33
commit
5dc40ba02d
|
@ -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')}
|
||||||
|
|
Loading…
Reference in New Issue