In the situation that you initialize the gallery without images and doing a refresh() afterwards, the preload functionality is not working.
This is caused by a bug in the function normalizeSettings(). This function sets the preload setting to 0 if there were no images.
Of course a reset() afterwards doesn't help, because the setting is already overwritten.
It seems better to do the Math.min check during the preload itself.
Steps to reproduce
1) Initialize the gallery with a nonzero preload, but no images.
2) Refresh the gallery with some images. Now the preload doesn't work.
Sample HTML markup
Environment
Browser and version - Chrome Version 130.0.6723.117 (Official Build) (64-bit)
Description
In the situation that you initialize the gallery without images and doing a refresh() afterwards, the preload functionality is not working. This is caused by a bug in the function normalizeSettings(). This function sets the preload setting to 0 if there were no images.
Of course a reset() afterwards doesn't help, because the setting is already overwritten.
It seems better to do the Math.min check during the preload itself.
Steps to reproduce
1) Initialize the gallery with a nonzero preload, but no images. 2) Refresh the gallery with some images. Now the preload doesn't work.
Sample HTML markup
Environment
Additional context