From 5b6b07af4801202b0d46454cf73ca60ea06db7a4 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Wed, 8 Sep 2021 20:12:03 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B02007=20-=20Portal:=20Don't=20show=20tool?= =?UTF-8?q?tip=20if=20empty=20on=20BrowseBrick=20items?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../portal/templates/bricks/browse/mode_list.html.twig | 4 ++-- .../portal/templates/bricks/browse/mode_mosaic.html.twig | 2 +- .../portal/templates/bricks/browse/mode_tree.html.twig | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/datamodels/2.x/itop-portal-base/portal/templates/bricks/browse/mode_list.html.twig b/datamodels/2.x/itop-portal-base/portal/templates/bricks/browse/mode_list.html.twig index 8650bc59cd..2932ba1cb2 100644 --- a/datamodels/2.x/itop-portal-base/portal/templates/bricks/browse/mode_list.html.twig +++ b/datamodels/2.x/itop-portal-base/portal/templates/bricks/browse/mode_list.html.twig @@ -79,7 +79,7 @@ // Building tooltip for the node // We have to concatenate the HTML as we return the raw HTML of the cell. If we did a jQuery.insertAfter, the tooltip would not be returned. // For the same reason, tooltip widget is created in "drawCallback" instead of here. - if( (data.tooltip !== undefined) && (data.tooltip !== '')) + if( (data.tooltip !== undefined) && ($(data.tooltip).text() !== '')) { cellElem.html( $('').attr('title', data.tooltip).attr('data-toggle', 'tooltip').html(data.name).prop('outerHTML') ); } @@ -267,7 +267,7 @@ "columns": getColumnsDefinition(), "order": [], "drawCallback": function(settings){ - // Tooltip has to been created here, as the render callback only returns a string, not an object. + // Tooltip has to be created here, as the render callback only returns a string, not an object. $(this).find('[data-toggle="tooltip"]').tooltip({container: 'body', html: true, trigger: 'hover', placement: 'right'}); // container option is necessary when in a table // Hiding pagination if only one page if($(this).closest('.dataTables_wrapper').find('.dataTables_paginate:last .paginate_button:not(.previous):not(.next)').length < 2) 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 23e298bec4..fa47bd0ebc 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 @@ -215,7 +215,7 @@ itemElem.append(aElem); // Building tooltip for the node - if( (item.tooltip !== undefined) && (item.tooltip !== '') ) + if( (item.tooltip !== undefined) && ($(item.tooltip).text() !== '') ) { aElem.attr('title', item.tooltip).attr('data-toggle', 'tooltip').tooltip({html: true, trigger: 'hover', placement: 'top'}); } 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 8be9831793..35f5d78ea7 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 @@ -204,7 +204,7 @@ liElem.append(aElem); // Building tooltip for the node - if( (item.tooltip !== undefined) && (item.tooltip !== '') ) + if( (item.tooltip !== undefined) && ($(item.tooltip).text() !== '') ) { nameElem.attr('title', item.tooltip).attr('data-toggle', 'tooltip').tooltip({html: true, trigger: 'hover', placement: 'right'}); }