Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-73158] avoid jumping layout due to tooltips #9263

Merged
merged 3 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ THE SOFTWARE.
</j:otherwise>
</j:choose>
<j:if test="${!item.params.isEmpty()}">
<div style="float:right;margin-right:10px;">
<l:icon src="symbol-parameters" class="icon-sm" tooltip="Build Parameters:${item.params}"/>
<div style="float:right;margin-right:10px;" tooltip="Build Parameters:${item.params}" -parent="true">
mawinter69 marked this conversation as resolved.
Show resolved Hide resolved
<l:icon src="symbol-parameters" class="icon-sm" />
</div>
</j:if>
</div>
Expand Down
1 change: 1 addition & 0 deletions core/src/main/resources/lib/hudson/progressBar.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ THE SOFTWARE.
<x:attribute name="class">app-progress-bar ${attrs.large?'app-progress-bar--large':null} ${attrs.red?'app-progress-bar--error':null}</x:attribute>
<x:attribute name="href">${attrs.href}</x:attribute>
<x:attribute name="tooltip">${attrs.tooltip}</x:attribute>
<x:attribute name="data-tooltip-append-to-parent">true</x:attribute>
<x:attribute name="id">${attrs.id}</x:attribute>
<x:attribute name="data-tooltip-template">${attrs.tooltipTemplate}</x:attribute>
<j:choose>
Expand Down
4 changes: 3 additions & 1 deletion core/src/main/resources/lib/hudson/queue.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ THE SOFTWARE.
<j:set var="stuck" value="${item.isStuck()}"/>
<j:choose>
<j:when test="${h.hasPermission(item.task,item.task.READ)}">
<a href="${rootURL}/${item.task.url}" class="model-link inside tl-tr" tooltip="${item.causesDescription} ${item.why} ${item.params} \n ${%WaitingFor(item.inQueueForString)}">
<a href="${rootURL}/${item.task.url}" class="model-link inside tl-tr"
tooltip="${item.causesDescription} ${item.why} ${item.params} \n ${%WaitingFor(item.inQueueForString)}"
data-tooltip-append-to-parent="true">
<l:breakable value="${item.displayName}"/>
</a>
<!-- TODO include estimated number as in BuildHistoryWidget/entries.jelly if possible -->
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/resources/lib/layout/stopButton.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ THE SOFTWARE.
</st:documentation>
<j:choose>
<j:when test="${confirm == null}">
<a class="stop-button-link" href="${href}" tooltip="${alt}">
<a class="stop-button-link" href="${href}" tooltip="${alt}" data-tooltip-append-to-parent="true">
<l:icon src="symbol-close" />
</a>
</j:when>
<j:otherwise>
<a class="stop-button-link" href="${href}" data-confirm="${confirm}" tooltip="${alt}">
<a class="stop-button-link" href="${href}" data-confirm="${confirm}" tooltip="${alt}" data-tooltip-append-to-parent="true">
<l:icon src="symbol-close" />
</a>
</j:otherwise>
Expand Down
7 changes: 6 additions & 1 deletion war/src/main/js/components/tooltips/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const TOOLTIP_BASE = {
arrow: false,
theme: "tooltip",
animation: "tooltip",
appendTo: "parent",
};

/**
Expand All @@ -21,6 +20,10 @@ function registerTooltip(element) {

const tooltip = element.getAttribute("tooltip");
const htmlTooltip = element.getAttribute("data-html-tooltip");
let appendTo = document.body;
if (element.hasAttribute("data-tooltip-append-to-parent")) {
appendTo = "parent";
}
if (
tooltip !== null &&
tooltip.trim().length > 0 &&
Expand All @@ -40,6 +43,7 @@ function registerTooltip(element) {
onHidden(instance) {
instance.reference.setAttribute("title", instance.props.content);
},
appendTo: appendTo,
},
TOOLTIP_BASE,
),
Expand All @@ -58,6 +62,7 @@ function registerTooltip(element) {
instance.reference.getAttribute("data-tooltip-interactive") ===
"true";
},
appendTo: appendTo,
},
TOOLTIP_BASE,
),
Expand Down