Commit 32e5acf8 authored by Jakob Moser's avatar Jakob Moser
Browse files

Add method to display as current, improve method to display as solved

parent 14a6dcfe
Loading
Loading
Loading
Loading
+14 −1
Changes for static/js/yalikejazz.mjs: 14 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -24,7 +24,20 @@ function findNextIncompleteExerciseIndex(currentExerciseIndex) {
 */
function displayAsSolved(cardEl) {
    cardEl.querySelector(".icon").classList.replace("bi-square", "bi-check-square")
    cardEl.querySelector(".title").setAttribute("title", "Diese Aufgabe ist bereits gelöst, du kannst nicht mehr zu ihr springen.")
    const titleEl = cardEl.querySelector(".title")
    titleEl.setAttribute("title", "Diese Aufgabe ist bereits gelöst, du kannst nicht mehr zu ihr springen.")
    titleEl.classList.remove("clickable")
}

/**
 * Changes the appearance of the given exercise card so it looks like it is current
 * @param {HTMLElement} cardEl The .card element
 */
function displayAsCurrent(cardEl) {
    cardEl.classList.remove("collapsed")
    const titleEl = cardEl.querySelector(".title")
    titleEl.setAttribute("title", "Du kannst nicht zur aktuellen Aufgabe springen.")
    titleEl.classList.remove("clickable")
}

/**