Skip to content

Commit

Permalink
flush saved comment selection after successful grader update
Browse files Browse the repository at this point in the history
  • Loading branch information
IonMich committed Jan 31, 2024
1 parent cb6572f commit a887e87
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion submissions/static/submissions/detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ function setInitialGradeStep() {


const text_area = document.getElementById("newCommentTextArea");
text_area.addEventListener("keydown", (event) => {
text_area.parentElement.addEventListener("keydown", (event) => {
if (event.key === "Enter" && event.ctrlKey) {
event.preventDefault();
graderUpdatesForm.dispatchEvent(new Event("submit"));
Expand Down Expand Up @@ -658,6 +658,12 @@ graderUpdatesForm.addEventListener("submit", async (event) => {
addStarBtnListener(newCommentDiv);
addEditBtnListener(newCommentDiv);
});
// deselect the selected option in the save comment selectpicker
$(savedCommentsSelect).selectpicker("deselectAll");
// reset the height of the preview text area
const previewCommentArea = document.querySelector("#newCommentPreview");
previewCommentArea.style.height = "auto";

// show a toast
const toastDiv = document.createElement("div");
toastDiv.classList.add("toast", "align-items-center", "text-bg-success", "border-0");
Expand Down

0 comments on commit a887e87

Please sign in to comment.