gaufre: hide it if the server is unavailable

use visiblity: hidden instead of display: none to prevent layout shifts.
This commit is contained in:
Emmanuel Pelletier
2024-05-15 09:52:42 +02:00
parent bdf31c94a0
commit 1618bb1d1b
2 changed files with 6 additions and 0 deletions

View File

@@ -84,3 +84,7 @@
[data-fr-scheme="dark"] .lasuite-gaufre-btn--vanilla:active {
background-color: #474747 !important;
}
html:not(.lasuite--gaufre-loaded) .lasuite-gaufre-btn {
visibility: hidden !important;
}

View File

@@ -2,6 +2,8 @@
const BUTTON_CLASS = "js-lasuite-gaufre-btn"
let lastFocusedButton = null
window.document.documentElement.classList.add("lasuite--gaufre-loaded")
if ("requestIdleCallback" in window) {
requestIdleCallback(() => {
appendPopup()