Portal: BrowseBrick: First level automatically opens when there is only one item in it, in order to display its subitems.

The opening of the root level is visible by the user so he can understand he is in a sublevel, not wondering where the root level went.

SVN:trunk[4729]
This commit is contained in:
Guillaume Lajarige
2017-05-10 15:22:13 +00:00
parent 05bb797768
commit 02c79fd0a2
2 changed files with 16 additions and 0 deletions

View File

@@ -406,6 +406,14 @@
buildMosaic(oRawDatas);
hideMosaicLoader();
registerFilterListeners();
// Open first level if only one item
if($('#brick_content_mosaic > .mosaic-group[data-level-id="L"] > .mosaic-group-item').length == 1)
{
setTimeout(function(){
$('#brick_content_mosaic > .mosaic-group[data-level-id="L"] > .mosaic-group-item > .mosaic-item').trigger('click');
}, 300);
}
});
</script>
{% endblock %}

View File

@@ -410,6 +410,14 @@
hideTreeLoader();
registerFilterListeners();
collapseAll();
// Open first level if only one item
if($('#brick_content_tree > .list-group-item').length == 1)
{
setTimeout(function(){
$('#brick_content_tree > .list-group-item > .tree-toggle').trigger('click');
}, 300);
}
{% if sSearchValue is not null %}
// Filters from default value