fix: conditionally hide sections in edit mode only

Wrapped the logic to hide sections in an edit mode check, ensuring it only runs when the page is in edit mode. This prevents unintended hiding of sections during normal view, improving the user experience.
This commit is contained in:
Kumi 2024-09-23 09:46:47 +02:00
parent a1185aba77
commit 8c1e8c49eb
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -212,6 +212,9 @@
); );
}); });
const editMode = $(".inplaceeditable").length > 0;
if (editMode) {
var sections = $('.course-section'); var sections = $('.course-section');
var found = false; var found = false;
@ -224,6 +227,7 @@
$(this).css('visibility', 'hidden'); $(this).css('visibility', 'hidden');
} }
}); });
}
}) })
}) })
.catch((error) => { .catch((error) => {