Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed "show-more-btn" toggle logic and added optional "collapseAfter" parameter #473

Merged
merged 3 commits into from
Dec 7, 2021

Conversation

fabiofenoglio
Copy link
Contributor

@fabiofenoglio fabiofenoglio commented Dec 7, 2021

Issue

Fixes #472

Description

Instead of looking for the first button matching "show-less-btn" in the page, only the buttons in the toggled sections are considered.

@fabiofenoglio
Copy link
Contributor Author

This PR also introduces an optional parameter collapseAfter to customize the number of items showed in the list before collapsing.

The default remains 2 so it's not influencing existing sites.

degrees:
- institution:
    name: Institution name
  icon: fa-certificate
  timeframe: 2017-present
  takenCourses:
    showGrades: false
    collapseAfter: 4 # new parameter
    courses:
    - name: element 1
    - name: element 2
    - name: element 3
    - name: element 4
    - name: element 5
    - name: element 6

@fabiofenoglio fabiofenoglio changed the title fixed "show-more-btn" toggle logic fixed "show-more-btn" toggle logic and added optional "collapseAfter" parameter Dec 7, 2021
Copy link
Member

@hossainemruz hossainemruz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @fabiofenoglio

@hossainemruz hossainemruz added automerge enhancement New feature or request labels Dec 7, 2021
@hossainemruz hossainemruz changed the title fixed "show-more-btn" toggle logic and added optional "collapseAfter" parameter Fixed "show-more-btn" toggle logic and added optional "collapseAfter" parameter Dec 7, 2021
@kodiakhq kodiakhq bot merged commit e3c84e0 into hugo-toha:main Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Show more" button in the "Taken Courses" toggles the wrong element
2 participants