ソースを参照

N°762 Portal: Pre-filtering a browse brick in tree mode was making tree collapsing instead of showing results.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4911 a333f486-631f-4898-b8df-5754b55c2be0
glajarige 7 年 前
コミット
2ed7756999

+ 1 - 0
datamodels/2.x/itop-portal-base/portal/src/views/bricks/browse/mode_mosaic.html.twig

@@ -408,6 +408,7 @@
 			registerFilterListeners();
 
 			// Open first level if only one item
+			// TODO: We must disable opening of first level when pre-filtering when filtering will be implemented
 			if($('#brick_content_mosaic > .mosaic-group[data-level-id="L"] > .mosaic-group-item').length == 1)
 			{
 			    setTimeout(function(){

+ 2 - 2
datamodels/2.x/itop-portal-base/portal/src/views/bricks/browse/mode_tree.html.twig

@@ -411,8 +411,8 @@
 			registerFilterListeners();
 			collapseAll();
 
-            // Open first level if only one item
-            if($('#brick_content_tree > .list-group-item').length == 1)
+            // Open first level if only one item and not pre-filtering
+            if( ($('#brick_content_tree > .list-group-item').length == 1) && ($('#brick_search_field').val() === '') )
             {
                 setTimeout(function(){
                     $('#brick_content_tree > .list-group-item > .tree-toggle').trigger('click');