From acf828b72e463401be9df4ad7e379c2d2e1d521b Mon Sep 17 00:00:00 2001 From: Molkobain Date: Tue, 11 May 2021 12:10:31 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B03995=20-=20Portal:=20Fix=20loader=20not?= =?UTF-8?q?=20displaying=20in=20BrowseBrick=20for=20tree/mosaic=20modes=20?= =?UTF-8?q?with=20huge=20amount=20of=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../portal/templates/bricks/browse/mode_mosaic.html.twig | 7 ++++--- .../portal/templates/bricks/browse/mode_tree.html.twig | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/datamodels/2.x/itop-portal-base/portal/templates/bricks/browse/mode_mosaic.html.twig b/datamodels/2.x/itop-portal-base/portal/templates/bricks/browse/mode_mosaic.html.twig index cca764f549..17bbb7c209 100644 --- a/datamodels/2.x/itop-portal-base/portal/templates/bricks/browse/mode_mosaic.html.twig +++ b/datamodels/2.x/itop-portal-base/portal/templates/bricks/browse/mode_mosaic.html.twig @@ -397,15 +397,16 @@ } } }; - + + // N°3995: Loader is shown immediately, otherwise when we have a huge amount of items, we can have a bottleneck on the buildMosaic() function, blocking the display of the loader + showMosaicLoader(); $(document).ready(function(){ // Auto collapse item actions popup $('body').click(function(){ $('#brick_content_mosaic .item-action-wrapper.collapse.in').collapse('hide'); }); - // Build the tree (collapsed) - showMosaicLoader(); + // Build the mosaic (collapsed) buildMosaic(oRawDatas); hideMosaicLoader(); registerFilterListeners(); diff --git a/datamodels/2.x/itop-portal-base/portal/templates/bricks/browse/mode_tree.html.twig b/datamodels/2.x/itop-portal-base/portal/templates/bricks/browse/mode_tree.html.twig index 1ecd1b9888..e850f80d2c 100644 --- a/datamodels/2.x/itop-portal-base/portal/templates/bricks/browse/mode_tree.html.twig +++ b/datamodels/2.x/itop-portal-base/portal/templates/bricks/browse/mode_tree.html.twig @@ -321,6 +321,8 @@ } }; + // N°3995: Loader is shown immediately, otherwise when we have a huge amount of items, we can have a bottleneck on the buildTree() function, blocking the display of the loader + showTreeLoader(); $(document).ready(function(){ // Init expand/collapse all buttons $('#btn-collapse-all').on('click', function (oEvent) { @@ -405,7 +407,6 @@ }); // Build the tree (collapsed) - showTreeLoader(); buildTree(oRawDatas); hideTreeLoader(); registerFilterListeners();