mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-29 03:35:25 +08:00
enables tooltip on long column names [fixes SCI-2427]
This commit is contained in:
parent
acd6efae57
commit
a8971b4e20
1 changed files with 29 additions and 0 deletions
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue