mvc/bootgrid - show tooltip when grid td content doesn't fit and remove similar functionality from Reporting: Unbound DNS to avoid duplication.

This commit is contained in:
Ad Schellevis 2024-01-04 16:01:31 +01:00
parent eed630092c
commit 92f282b295
2 changed files with 9 additions and 1 deletions

View File

@ -632,7 +632,7 @@
return row.resolve_time_ms + 'ms';
},
"domain": function (column, row) {
return '<span class="domain-content" data-toggle="tooltip" title="' + row.domain + '">' + row.domain + '</span>';
return row.domain;
},
"commands": function (column, row) {
if (bl_enabled.enabled == 0) {

View File

@ -543,6 +543,14 @@ $.fn.UIBootgrid = function (params) {
$(this).tooltip();
});
// tooltip when ellipsis is used (overflow on text elements without children)
$(this).find("td").bind('mouseenter', function(){
let $this = $(this);
if (this.offsetWidth < this.scrollWidth && !$this.attr('title') && $this.children().length == 0){
$this.attr('title', $this.text()).tooltip({container: 'body', trigger: 'hover'}).tooltip('show');
}
});
// hook all events
const commands = this_grid.getCommands();
Object.keys(commands).map(function (k) {