Ver código fonte

Fix takenCourses buttons (#772)

Bernat Borràs Civil 1 ano atrás
pai
commit
a128873f20

+ 2 - 5
assets/scripts/sections/education.js

@@ -22,12 +22,9 @@ function toggleCourseVisibility (elem) {
 }
 
 window.addEventListener('DOMContentLoaded', () => {
-  const els = [
-    document.getElementById('show-more-btn'),
-    document.getElementById('show-less-btn')
-  ]
+  const els = Array.from(document.getElementsByClassName('btn'));
 
-  els.filter((el) => el != null).forEach((el) =>
+  els.filter((el) => el != null && (el.id == 'show-more-btn' || el.id == 'show-less-btn')).forEach((el) =>
     el.addEventListener('click', ({ target }) =>
       toggleCourseVisibility(target)))
 })

+ 4 - 0
assets/styles/sections/education.scss

@@ -122,6 +122,10 @@
   .taken-courses ul {
     margin-bottom: 0;
   }
+
+  .hidden {
+    display: none;
+  }
   
   /*============ Education Alter Template =============*/
   .education-alt .degree-info {