gjbarnard / moodle-theme_foundation

Foundation theme for Moodle.
GNU General Public License v3.0
8 stars 0 forks source link

Carousel does not start automatically #9

Closed leonstr closed 3 years ago

leonstr commented 3 years ago

To reproduce this add two slide images and go to the front page. The first image is displayed only. In the browser's console the following error appears when the page loads:

Error: No define call for theme_boost/carousel
http://requirejs.org/docs/errors.html#nodefine require.min.js:5:1067

If you click the ‹ or › buttons the carousel starts.

Issue occurs with: Moodle 3.10.1+ (Build: 20210204) and Foundation 3.10.0.1 (2020110800) Moodle 3.9.4+ (Build: 20210204) and Foundation 3.9.1.2 (2020061603)

Works as expected with: Moodle 3.8.7 (Build: 20210118) and Foundation 3.8.1.0 (2019111001)

gjb2048 commented 3 years ago

@leonstr Thanks for the report, I'll look into it.

leonstr commented 3 years ago

It looks like Bootstrap features like carousel got moved into a subdirectory in Moodle 3.9 so maybe theme/foundation/templates/partials/carousel.mustache should say:

 60 require(['jquery', 'theme_boost/bootstrap/carousel'], function($) {
 61     $('#{{carouselid}}').carousel();
 62 });

(That Bootstrap change doesn't seem to be very well documented in Moodle's release notes, no mention of it in theme/upgrade.txt either).