#31 : Rename applyAutoplay -> applyAutoplayIfNeeded

This commit is contained in:
Vadim
2021-07-15 19:40:08 +03:00
parent 8c03229f60
commit aa52abb7a8

View File

@@ -169,7 +169,7 @@
pagesElement.append(first.cloneNode(true))
}
function applyAutoplay(options) {
function applyAutoplayIfNeeded(options) {
// prevent progress change if not infinite for first and last page
if (
!infinite && (
@@ -211,7 +211,7 @@
applyPageSizes()
}
applyAutoplay()
applyAutoplayIfNeeded()
addResizeEventListener(applyPageSizes)
})()
@@ -269,7 +269,7 @@
setTimeout(() => {
offsetPage(animated)
const jumped = jumpIfNeeded()
!jumped && applyAutoplay({ delaysMs: _duration })
!jumped && applyAutoplayIfNeeded({ delaysMs: _duration })
}, offsetDelayMs)
}, { animated })
}
@@ -279,7 +279,7 @@
store.prev({ infinite, pagesCount })
offsetPage(animated)
const jumped = jumpIfNeeded()
!jumped && applyAutoplay({ delaysMs: _duration })
!jumped && applyAutoplayIfNeeded({ delaysMs: _duration })
}, { animated })
}
function showNextPage(options) {
@@ -288,7 +288,7 @@
store.next({ infinite, pagesCount })
offsetPage(animated)
const jumped = jumpIfNeeded()
!jumped && applyAutoplay({ delaysMs: _duration })
!jumped && applyAutoplayIfNeeded({ delaysMs: _duration })
}, { animated })
}