enables tooltip on long column names [fixes SCI-2427]

This commit is contained in:
zmagod 2018-06-11 15:22:56 +02:00
parent acd6efae57
commit a8971b4e20

View file

@ -214,6 +214,7 @@ var RepositoryDatatable = (function(global) {
bindExportActions();
disableCheckboxToggleOnAssetDownload();
initPreviewModal();
initHeaderTooltip();
}
});
@ -1093,6 +1094,34 @@ var RepositoryDatatable = (function(global) {
TABLE.button(0).enable(false);
}
function initHeaderTooltip() {
// Fix compatibility of fixed table header and column names modal-tooltip
$('.modal-tooltip').off();
$('.modal-tooltip').hover(function() {
var $tooltip = $(this).find('.modal-tooltiptext');
var offsetLeft = $tooltip.offset().left;
(offsetLeft + 200) > $(window).width() ? offsetLeft -= 150 : offsetLeft;
var offsetTop = $tooltip.offset().top;
$('body').append($tooltip);
$tooltip.css('background-color', '#d2d2d2');
$tooltip.css('border-radius', '6px');
$tooltip.css('color', '#333');
$tooltip.css('display', 'block');
$tooltip.css('left', offsetLeft + 'px');
$tooltip.css('padding', '5px');
$tooltip.css('position', 'absolute');
$tooltip.css('text-align', 'center');
$tooltip.css('top', offsetTop + 'px');
$tooltip.css('visibility', 'visible');
$tooltip.css('width', '200px');
$tooltip.css('word-wrap', 'break-word');
$(this).data('dropdown-tooltip', $tooltip);
}, function() {
$(this).append($(this).data('dropdown-tooltip'));
$(this).data('dropdown-tooltip').removeAttr('style');
});
}
/*
* Repository columns dropdown
*/