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

sk-fading-circle pushing visible section down instead of hiding it #274

Open
aneno-m-e opened this issue Jan 29, 2024 · 0 comments
Open

Comments

@aneno-m-e
Copy link

Hi team,

We noticed that in courses with topics or weeks formats, when switching sections, the loading animation would push the section that was active down as it's being displayed. The previous behaviour was the animation showing and the section being hidden.

I looked into it and found the cause of this issue. In the Moodle 3.9 branch, the

    tag containing the different course sections would be created with echo $this->start_section_list(); and get a class of 'topics' or 'weeks', depending on the course format.
    Then, when changing section, javascript will hide the elements matching the following pattern $('.course-content .' + self.courseConfig.format + ' li[id^="section-"]') when retrieving a new section, before displaying it (https://github.com/open-lms-open-source/moodle-theme_snap/blob/master/amd/src/section_asset_management.js#L180).

    This is now broken, as in 4.1, the class is set to 'sections', which does not match the possible course formats.

    Our solution was to change
    $('.course-content .' + self.courseConfig.format + ' li[id^="section-"]').hide();
    to be
    $('.course-content .sections li[id^="section-"]').hide();

    If you are happy with this approach, let me know and I'll create a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant