Skip to content

Commit dff0cf1

Browse files
Closing of popup message for quick action
1 parent fdbef2f commit dff0cf1

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

index.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,12 +324,24 @@
324324
let printText = document.getElementById("printText");
325325
printText.classList.remove("show");
326326
}
327-
327+
328328
function hideErrorText() {
329329
let errorText = document.getElementById("errorText");
330330
errorText.classList.remove("show");
331331
hideArrows(); // This function is declared in js/activity.js
332332
}
333+
334+
document.addEventListener("click", function (event) {
335+
let printText = document.getElementById("printText");
336+
let errorText = document.getElementById("errorText");
337+
338+
if (printText && printText.classList.contains("show") && !printText.contains(event.target)) {
339+
hidePrintText();
340+
}
341+
if (errorText && errorText.classList.contains("show") && !errorText.contains(event.target)) {
342+
hideErrorText();
343+
}
344+
});
333345
</script>
334346

335347
<div id ="canvasContainer">

0 commit comments

Comments
 (0)