mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 15:22:17 +02:00
N°2007 - Portal: Don't show tooltip if empty on BrowseBrick items
This commit is contained in:
@@ -79,7 +79,7 @@
|
|||||||
// Building tooltip for the node
|
// 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.
|
// 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.
|
// 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') );
|
cellElem.html( $('<span></span>').attr('title', data.tooltip).attr('data-toggle', 'tooltip').html(data.name).prop('outerHTML') );
|
||||||
}
|
}
|
||||||
@@ -267,7 +267,7 @@
|
|||||||
"columns": getColumnsDefinition(),
|
"columns": getColumnsDefinition(),
|
||||||
"order": [],
|
"order": [],
|
||||||
"drawCallback": function(settings){
|
"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
|
$(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
|
// Hiding pagination if only one page
|
||||||
if($(this).closest('.dataTables_wrapper').find('.dataTables_paginate:last .paginate_button:not(.previous):not(.next)').length < 2)
|
if($(this).closest('.dataTables_wrapper').find('.dataTables_paginate:last .paginate_button:not(.previous):not(.next)').length < 2)
|
||||||
|
|||||||
@@ -215,7 +215,7 @@
|
|||||||
itemElem.append(aElem);
|
itemElem.append(aElem);
|
||||||
|
|
||||||
// Building tooltip for the node
|
// 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'});
|
aElem.attr('title', item.tooltip).attr('data-toggle', 'tooltip').tooltip({html: true, trigger: 'hover', placement: 'top'});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -204,7 +204,7 @@
|
|||||||
liElem.append(aElem);
|
liElem.append(aElem);
|
||||||
|
|
||||||
// Building tooltip for the node
|
// 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'});
|
nameElem.attr('title', item.tooltip).attr('data-toggle', 'tooltip').tooltip({html: true, trigger: 'hover', placement: 'right'});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user