From de678ec3a1107377f4a51486f026679f85d79cf2 Mon Sep 17 00:00:00 2001 From: Marcin Kowalicki Date: Tue, 12 Jan 2021 01:59:33 +0100 Subject: [PATCH] Add more info about grade in modal --- files/js/grades.js | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/files/js/grades.js b/files/js/grades.js index 010cab8..22df349 100644 --- a/files/js/grades.js +++ b/files/js/grades.js @@ -32,38 +32,57 @@ const getGrades = () => { switch (czastkowa.Wpis) { case "6" || "6-": + czastkowa.Kolor = "#3dbbf5" gradeDiv.style.background = "#3dbbf5" break; case "5" || "5-" || "5+": + czastkowa.Kolor = "#4caf50" gradeDiv.style.background = "#4caf50" break; case "4" || "4-" || "4+": + czastkowa.Kolor = "#a0c431" gradeDiv.style.background = "#a0c431" break; case "3" || "3-" || "3+": + czastkowa.Kolor = "#ffb940" gradeDiv.style.background = "#ffb940" break; case "2" || "2-" || "2+": + czastkowa.Kolor = "#ff774d" gradeDiv.style.background = "#ff774d" break; case "1" || "1+": + czastkowa.Kolor = "#d43f3f" gradeDiv.style.background = "#d43f3f" break; default: + czastkowa.Kolor = "#607d8b" gradeDiv.style.background = "#607d8b" } const gradeModal = document.createElement("div") gradeModal.id = `${hash.MD5(czastkowa)}` gradeModal.classList = "modal" + gradeModal.style.marginTop = "15rem" gradeModal.innerHTML = ` ` gradeDiv.addEventListener('click', () => { - console.log(`Nauczyciel: ${czastkowa.Nauczyciel}, Waga: ${czastkowa.Waga}, Data: ${czastkowa.DataOceny}, Przedmiot: ${grade.Przedmiot}`) + console.log(czastkowa) gradeModal.style.display = 'block' })