Fix carousel not working when item is deleted or no items at all
This commit is contained in:
parent
4b494dcc7a
commit
5075a218b5
|
@ -21,6 +21,11 @@ app.carousel = {
|
|||
const elements = mod._elements();
|
||||
const current = elements[mod._current];
|
||||
const next = elements[i];
|
||||
if (next === undefined) {
|
||||
if (i > 0)
|
||||
return app.carousel.set(mod, 0);
|
||||
return false;
|
||||
}
|
||||
var direction = 'none';
|
||||
if (i > mod._current)
|
||||
direction = 'right';
|
||||
|
|
Loading…
Reference in New Issue