Skip to content

Commit

Permalink
followup for jenkinsci#8941, don't animate on page load
Browse files Browse the repository at this point in the history
PR jenkinsci#8941 caused a regression that the hiding animation was played on
page load.
This change ensures that the hiding animation is only applied when the
widget was visible before
  • Loading branch information
mawinter69 committed Feb 12, 2024
1 parent 8b94924 commit b192768
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,13 @@
box-shadow: var(--dropdown-box-shadow);
border-radius: 15px;
opacity: 0;
animation: hide-am-list 300ms ease-in 1 normal;
z-index: 0;
}

.am-container.am-hidden div.am-list {
animation: hide-am-list 300ms ease-in 1 normal;
}

.am-container.visible div.am-list {
opacity: 1;
animation: show-am-list 300ms ease-in 1 normal forwards;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
var popupContent = responseText;
amList.innerHTML = popupContent;
amMonitorRoot.classList.add("visible");
amMonitorRoot.classList.remove("am-hidden");
document.addEventListener("click", onClose);
document.addEventListener("keydown", onEscClose);

Expand All @@ -50,6 +51,9 @@
}

function close() {
if (amMonitorRoot.classList.contains("visible")) {
amMonitorRoot.classList.add("am-hidden");
}
amMonitorRoot.classList.remove("visible");
document.removeEventListener("click", onClose);
document.removeEventListener("keydown", onEscClose);
Expand Down

0 comments on commit b192768

Please sign in to comment.