|
@@ -1026,7 +1026,7 @@ function Layout(Splide2, Components2, options) {
|
|
const { Slides } = Components2;
|
|
const { Slides } = Components2;
|
|
const { resolve } = Components2.Direction;
|
|
const { resolve } = Components2.Direction;
|
|
const { root, track, list } = Components2.Elements;
|
|
const { root, track, list } = Components2.Elements;
|
|
- const { getAt } = Slides;
|
|
|
|
|
|
+ const { getAt, style: styleSlides } = Slides;
|
|
let vertical;
|
|
let vertical;
|
|
let rootRect;
|
|
let rootRect;
|
|
function mount() {
|
|
function mount() {
|
|
@@ -1047,16 +1047,13 @@ function Layout(Splide2, Components2, options) {
|
|
const newRect = rect(root);
|
|
const newRect = rect(root);
|
|
if (!rootRect || rootRect.width !== newRect.width || rootRect.height !== newRect.height) {
|
|
if (!rootRect || rootRect.width !== newRect.width || rootRect.height !== newRect.height) {
|
|
style(track, "height", cssTrackHeight());
|
|
style(track, "height", cssTrackHeight());
|
|
- Slides.style(resolve("marginRight"), unit(options.gap));
|
|
|
|
- Slides.style("width", cssSlideWidth() || null);
|
|
|
|
- setSlidesHeight();
|
|
|
|
|
|
+ styleSlides(resolve("marginRight"), unit(options.gap));
|
|
|
|
+ styleSlides("width", cssSlideWidth() || null);
|
|
|
|
+ styleSlides("height", cssSlideHeight() || null, true);
|
|
rootRect = newRect;
|
|
rootRect = newRect;
|
|
emit(EVENT_RESIZED);
|
|
emit(EVENT_RESIZED);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- function setSlidesHeight() {
|
|
|
|
- Slides.style("height", cssSlideHeight() || null, true);
|
|
|
|
- }
|
|
|
|
function cssPadding(right) {
|
|
function cssPadding(right) {
|
|
const { padding } = options;
|
|
const { padding } = options;
|
|
const prop = resolve(right ? "right" : "left");
|
|
const prop = resolve(right ? "right" : "left");
|
|
@@ -1197,9 +1194,6 @@ function Move(Splide2, Components2, options) {
|
|
Transition = Components2.Transition;
|
|
Transition = Components2.Transition;
|
|
on([EVENT_MOUNTED, EVENT_RESIZED, EVENT_UPDATED, EVENT_REFRESH], reposition);
|
|
on([EVENT_MOUNTED, EVENT_RESIZED, EVENT_UPDATED, EVENT_REFRESH], reposition);
|
|
}
|
|
}
|
|
- function destroy() {
|
|
|
|
- removeAttribute(list, "style");
|
|
|
|
- }
|
|
|
|
function reposition() {
|
|
function reposition() {
|
|
if (!isBusy()) {
|
|
if (!isBusy()) {
|
|
Components2.Scroll.cancel();
|
|
Components2.Scroll.cancel();
|
|
@@ -1307,7 +1301,6 @@ function Move(Splide2, Components2, options) {
|
|
}
|
|
}
|
|
return {
|
|
return {
|
|
mount,
|
|
mount,
|
|
- destroy,
|
|
|
|
move,
|
|
move,
|
|
jump,
|
|
jump,
|
|
translate,
|
|
translate,
|