Spaces:
Running
Running
Update interface.js
Browse files- interface.js +16 -2
interface.js
CHANGED
|
@@ -191,7 +191,10 @@ const currentScriptTag = document.currentScript;
|
|
| 191 |
setMenuContentMaxSize();
|
| 192 |
window.addEventListener('resize', setMenuContentMaxSize);
|
| 193 |
document.addEventListener('fullscreenchange', setMenuContentMaxSize);
|
| 194 |
-
window.addEventListener('orientationchange',
|
|
|
|
|
|
|
|
|
|
| 195 |
|
| 196 |
// 9) Aide visible par défaut
|
| 197 |
menuContent.style.display = 'none';
|
|
@@ -236,6 +239,13 @@ const currentScriptTag = document.currentScript;
|
|
| 236 |
annLinkBtn.className = 'ann-link-btn';
|
| 237 |
annFooter.appendChild(annLinkBtn);
|
| 238 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 239 |
annTooltip.appendChild(annCloseBtn);
|
| 240 |
annTooltip.appendChild(annImgWrap);
|
| 241 |
annTooltip.appendChild(annScroll);
|
|
@@ -329,7 +339,8 @@ const currentScriptTag = document.currentScript;
|
|
| 329 |
} else {
|
| 330 |
annFooter.style.display = 'none';
|
| 331 |
}
|
| 332 |
-
|
|
|
|
| 333 |
annIsOpen = true;
|
| 334 |
annOverlay.classList.add('ann-open');
|
| 335 |
});
|
|
@@ -529,6 +540,7 @@ const currentScriptTag = document.currentScript;
|
|
| 529 |
});
|
| 530 |
|
| 531 |
document.addEventListener('fullscreenchange', () => {
|
|
|
|
| 532 |
if (!document.fullscreenElement && isFullscreen) {
|
| 533 |
isFullscreen = false;
|
| 534 |
restoreOriginalStyles();
|
|
@@ -541,6 +553,7 @@ const currentScriptTag = document.currentScript;
|
|
| 541 |
|
| 542 |
// ── Resize : recalcule la hauteur en dvh sur iOS ──
|
| 543 |
window.addEventListener('resize', () => {
|
|
|
|
| 544 |
if (viewerModule.app) {
|
| 545 |
if (isFullscreen) {
|
| 546 |
viewerModule.app.resizeCanvas(window.innerWidth, window.innerHeight);
|
|
@@ -607,6 +620,7 @@ const currentScriptTag = document.currentScript;
|
|
| 607 |
|
| 608 |
// 17) Init par défaut
|
| 609 |
setTimeout(() => {
|
|
|
|
| 610 |
saveCurrentState();
|
| 611 |
document.dispatchEvent(
|
| 612 |
new CustomEvent('toggle-tooltips', { detail: { visible: !!config.showTooltipsDefault } })
|
|
|
|
| 191 |
setMenuContentMaxSize();
|
| 192 |
window.addEventListener('resize', setMenuContentMaxSize);
|
| 193 |
document.addEventListener('fullscreenchange', setMenuContentMaxSize);
|
| 194 |
+
window.addEventListener('orientationchange', () => {
|
| 195 |
+
updateAnnMaxHeight();
|
| 196 |
+
setMenuContentMaxSize();
|
| 197 |
+
});
|
| 198 |
|
| 199 |
// 9) Aide visible par défaut
|
| 200 |
menuContent.style.display = 'none';
|
|
|
|
| 239 |
annLinkBtn.className = 'ann-link-btn';
|
| 240 |
annFooter.appendChild(annLinkBtn);
|
| 241 |
|
| 242 |
+
function updateAnnMaxHeight() {
|
| 243 |
+
const containerH = widgetContainer.offsetHeight;
|
| 244 |
+
if (containerH > 0) {
|
| 245 |
+
widgetContainer.style.setProperty('--ann-max-h', Math.floor(containerH * 0.9) + 'px');
|
| 246 |
+
}
|
| 247 |
+
}
|
| 248 |
+
|
| 249 |
annTooltip.appendChild(annCloseBtn);
|
| 250 |
annTooltip.appendChild(annImgWrap);
|
| 251 |
annTooltip.appendChild(annScroll);
|
|
|
|
| 339 |
} else {
|
| 340 |
annFooter.style.display = 'none';
|
| 341 |
}
|
| 342 |
+
|
| 343 |
+
updateAnnMaxHeight();
|
| 344 |
annIsOpen = true;
|
| 345 |
annOverlay.classList.add('ann-open');
|
| 346 |
});
|
|
|
|
| 540 |
});
|
| 541 |
|
| 542 |
document.addEventListener('fullscreenchange', () => {
|
| 543 |
+
updateAnnMaxHeight();
|
| 544 |
if (!document.fullscreenElement && isFullscreen) {
|
| 545 |
isFullscreen = false;
|
| 546 |
restoreOriginalStyles();
|
|
|
|
| 553 |
|
| 554 |
// ── Resize : recalcule la hauteur en dvh sur iOS ──
|
| 555 |
window.addEventListener('resize', () => {
|
| 556 |
+
updateAnnMaxHeight();
|
| 557 |
if (viewerModule.app) {
|
| 558 |
if (isFullscreen) {
|
| 559 |
viewerModule.app.resizeCanvas(window.innerWidth, window.innerHeight);
|
|
|
|
| 620 |
|
| 621 |
// 17) Init par défaut
|
| 622 |
setTimeout(() => {
|
| 623 |
+
updateAnnMaxHeight();
|
| 624 |
saveCurrentState();
|
| 625 |
document.dispatchEvent(
|
| 626 |
new CustomEvent('toggle-tooltips', { detail: { visible: !!config.showTooltipsDefault } })
|