Spaces:
Running
Running
Update interface.js
Browse files- interface.js +10 -7
interface.js
CHANGED
|
@@ -336,7 +336,7 @@ const currentScriptTag = document.currentScript;
|
|
| 336 |
|
| 337 |
tooltipCloseBtn.addEventListener('click', hideTooltipPanel);
|
| 338 |
|
| 339 |
-
|
| 340 |
// Always show panel, cancel hide first
|
| 341 |
if (dragHide) {
|
| 342 |
viewerContainerElem.removeEventListener('pointermove', dragHide);
|
|
@@ -356,12 +356,15 @@ const currentScriptTag = document.currentScript;
|
|
| 356 |
tooltipImage.style.display = 'none';
|
| 357 |
}
|
| 358 |
tooltipPanel.style.display = 'flex';
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
|
|
|
|
|
|
|
|
|
| 365 |
});
|
| 366 |
|
| 367 |
if (canvasEl) {
|
|
|
|
| 336 |
|
| 337 |
tooltipCloseBtn.addEventListener('click', hideTooltipPanel);
|
| 338 |
|
| 339 |
+
document.addEventListener('tooltip-selected', (evt) => {
|
| 340 |
// Always show panel, cancel hide first
|
| 341 |
if (dragHide) {
|
| 342 |
viewerContainerElem.removeEventListener('pointermove', dragHide);
|
|
|
|
| 356 |
tooltipImage.style.display = 'none';
|
| 357 |
}
|
| 358 |
tooltipPanel.style.display = 'flex';
|
| 359 |
+
// --- DELAYED pointermove handler ---
|
| 360 |
+
setTimeout(() => {
|
| 361 |
+
dragHide = (e) => {
|
| 362 |
+
if ((e.pointerType === 'mouse' && e.buttons !== 0) || e.pointerType === 'touch') {
|
| 363 |
+
hideTooltipPanel();
|
| 364 |
+
}
|
| 365 |
+
};
|
| 366 |
+
viewerContainerElem.addEventListener('pointermove', dragHide);
|
| 367 |
+
}, 100);
|
| 368 |
});
|
| 369 |
|
| 370 |
if (canvasEl) {
|