Browse Source

Display an icon when there is a note.

Lee Morgan 1 year ago
parent
commit
7d682a4ee3
3 changed files with 28 additions and 1 deletions
  1. 10 0
      views/css/session.css
  2. 4 1
      views/index.html
  3. 14 0
      views/js/pages/session.js

+ 10 - 0
views/css/session.css

@@ -58,6 +58,16 @@
 
 #sessionNotesBtn{
     margin-bottom: 5px;
+    position: relative;
+}
+
+#sessionNotesIcon{
+    position: absolute;
+    top: -10px;
+    left: -15px;
+    font-size: 35px;
+    font-weight: bold;
+    color: var(--accent);
 }
 
 #sessionNotesText{

+ 4 - 1
views/index.html

@@ -150,7 +150,10 @@
         <p id="previousSession"></p>
 
         <div id="sessionButtonBox">
-            <button id="sessionNotesBtn" class="button">Notes</button>
+            <button id="sessionNotesBtn" class="button">
+                <p id="sessionNotesIcon" style="display:none">*</p>
+                Notes
+            </button>
             <button id="sessionAddSet" class="button">Add Set</button>
         </div>
 

+ 14 - 0
views/js/pages/session.js

@@ -124,6 +124,13 @@ export default {
                 });
         }
 
+        const noteIcon = document.getElementById("sessionNotesIcon");
+        console.log(newNote);
+        if(newNote === ""){
+            noteIcon.style.display = "none";
+        }else{
+            noteIcon.style.display = "flex";
+        }
         document.getElementById("sessionNotesText").style.display = "none";
     },
 
@@ -192,6 +199,13 @@ export default {
             case "weights": this.displayWeightSets(exercise.sets, setsContainer);
         }
 
+        const noteIcon = document.getElementById("sessionNotesIcon");
+        if(this.workout.exercises[this.exerciseIndex].notes !== ""){
+            noteIcon.style.display = "flex";
+        }else{
+            noteIcon.style.display = "none";
+        }
+
         window.scrollTo(0, 0);
     },