mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-09 14:13:16 +08:00
Improved tooltip handling in samples datatable [SCI-855]
This commit is contained in:
parent
35b8638598
commit
fb49ce8be2
1 changed files with 27 additions and 0 deletions
|
@ -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){
|
||||
|
|
Loading…
Reference in a new issue