Improved tooltip handling in samples datatable [SCI-855]

This commit is contained in:
Oleksii Kriuchykhin 2017-01-16 14:24:31 +01:00
parent 35b8638598
commit fb49ce8be2

View file

@ -162,6 +162,7 @@ function dataTableInit() {
table.on('mousedown', function() {
$('#samples-columns-dropdown').removeClass('open');
});
initHeaderTooltip();
}
});
@ -350,6 +351,32 @@ function appendSamplesIdToForm(form) {
});
}
function initHeaderTooltip() {
// Fix compatibility of fixed table header and column names modal-tooltip
$('.modal-tooltip').hover(function() {
var $tooltip = $(this).find('.modal-tooltiptext');
var offsetLeft = $tooltip.offset().left;
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');
});
}
//Show sample info
function sampleInfoListener() {
$(".sample_info").on("click", function(e){