N°2007 - Portal: Don't show tooltip if empty on BrowseBrick items

This commit is contained in:
Molkobain
2021-09-08 20:12:03 +02:00
parent 1331bc2139
commit 5b6b07af48
3 changed files with 4 additions and 4 deletions

View File

@@ -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( $('<span></span>').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)

View File

@@ -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'});
}

View File

@@ -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'});
}