Merge pull request #7314 from sboursen-scinote/sb_SCI-10457

Fix unsaved changes warning behavior on experiment canvas [SCI-10475]
This commit is contained in:
ajugo 2024-03-18 16:42:41 +01:00 committed by GitHub
commit f6aefd8f1d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -553,6 +553,11 @@ function handleAnchorClick(event) {
const targetUrl = event.target.href; const targetUrl = event.target.href;
const alertText = $("#update-canvas").attr("data-unsaved-work-text"); const alertText = $("#update-canvas").attr("data-unsaved-work-text");
if (!alertText) {
window.location.href = targetUrl;
return;
}
const exit = confirm(alertText); const exit = confirm(alertText);
if (exit) { if (exit) {