From a128873f2099bb7684c7b3a268e9dc29c633888c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernat=20Borr=C3=A0s=20Civil?= <70479573+BernatBC@users.noreply.github.com> Date: Mon, 3 Jul 2023 18:14:35 +0200 Subject: [PATCH] Fix takenCourses buttons (#772) --- assets/scripts/sections/education.js | 7 ++----- assets/styles/sections/education.scss | 4 ++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/assets/scripts/sections/education.js b/assets/scripts/sections/education.js index ea86c7e..91811cb 100644 --- a/assets/scripts/sections/education.js +++ b/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))) }) diff --git a/assets/styles/sections/education.scss b/assets/styles/sections/education.scss index 93596f0..2c84132 100644 --- a/assets/styles/sections/education.scss +++ b/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 {