mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-11 07:34:41 +08:00
Merge pull request #1205 from ZmagoD/zd_SCI_2427
enables tooltip on long column names [fixes SCI-2427]
This commit is contained in:
commit
d457a66996
1 changed files with 29 additions and 0 deletions
|
@ -215,6 +215,7 @@ var RepositoryDatatable = (function(global) {
|
||||||
bindExportActions();
|
bindExportActions();
|
||||||
disableCheckboxToggleOnAssetDownload();
|
disableCheckboxToggleOnAssetDownload();
|
||||||
initPreviewModal();
|
initPreviewModal();
|
||||||
|
initHeaderTooltip();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1094,6 +1095,34 @@ var RepositoryDatatable = (function(global) {
|
||||||
TABLE.button(0).enable(false);
|
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
|
* Repository columns dropdown
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue