Reposition the tooltip when they are loaded.
At the end of the asynchronous load, the tooltips need to be repositionned, since the size of the content may have changed.
This commit is contained in:
@@ -241,10 +241,24 @@ Kanboard.Board = (function() {
|
||||
return;
|
||||
}
|
||||
|
||||
var _this = this;
|
||||
$.get(href, function setTooltipContent(data) {
|
||||
|
||||
$('.ui-tooltip-content:visible').html(data);
|
||||
|
||||
var tooltip = $('.ui-tooltip:visible');
|
||||
|
||||
// Clear previous position, it interferes with the updated position computation
|
||||
tooltip.css({ top: '', left: '' });
|
||||
|
||||
// Remove arrow, it will be added when repositionning
|
||||
tooltip.children('.tooltip-arrow').remove();
|
||||
|
||||
// Reposition the tooltip
|
||||
var position = $(_this).tooltip("option", "position");
|
||||
position.of = $(_this);
|
||||
tooltip.position(position);
|
||||
|
||||
// Toggle subtasks status
|
||||
$('#tooltip-subtasks a').click(function(e) {
|
||||
|
||||
|
||||
@@ -65,10 +65,24 @@ Kanboard.Board = (function() {
|
||||
return;
|
||||
}
|
||||
|
||||
var _this = this;
|
||||
$.get(href, function setTooltipContent(data) {
|
||||
|
||||
$('.ui-tooltip-content:visible').html(data);
|
||||
|
||||
var tooltip = $('.ui-tooltip:visible');
|
||||
|
||||
// Clear previous position, it interferes with the updated position computation
|
||||
tooltip.css({ top: '', left: '' });
|
||||
|
||||
// Remove arrow, it will be added when repositionning
|
||||
tooltip.children('.tooltip-arrow').remove();
|
||||
|
||||
// Reposition the tooltip
|
||||
var position = $(_this).tooltip("option", "position");
|
||||
position.of = $(_this);
|
||||
tooltip.position(position);
|
||||
|
||||
// Toggle subtasks status
|
||||
$('#tooltip-subtasks a').click(function(e) {
|
||||
|
||||
@@ -220,4 +234,4 @@ Kanboard.Board = (function() {
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user