Pass options to goToPrev, goToNext
This commit is contained in:
@@ -210,25 +210,29 @@
|
|||||||
}, animated ? duration : 0)
|
}, animated ? duration : 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
function showPage(pageIndex, { offsetDelayMs, animated }) {
|
function showPage(pageIndex, options) {
|
||||||
|
const animated = get(options, 'animated', true)
|
||||||
|
const offsetDelayMs = get(options, 'offsetDelayMs', true)
|
||||||
safeChangePage(() => {
|
safeChangePage(() => {
|
||||||
store.moveToPage({ pageIndex, pagesCount })
|
store.moveToPage({ pageIndex, pagesCount })
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
offsetPage(animated)
|
offsetPage(animated)
|
||||||
}, offsetDelayMs)
|
}, offsetDelayMs)
|
||||||
})
|
}, { animated })
|
||||||
}
|
}
|
||||||
function showPrevPage() {
|
function showPrevPage(options) {
|
||||||
|
const animated = get(options, 'animated', true)
|
||||||
safeChangePage(() => {
|
safeChangePage(() => {
|
||||||
store.prev({ infinite, pagesCount })
|
store.prev({ infinite, pagesCount })
|
||||||
offsetPage(true)
|
offsetPage(animated)
|
||||||
})
|
}, { animated })
|
||||||
}
|
}
|
||||||
function showNextPage() {
|
function showNextPage(options) {
|
||||||
|
const animated = get(options, 'animated', true)
|
||||||
safeChangePage(() => {
|
safeChangePage(() => {
|
||||||
store.next({ infinite, pagesCount })
|
store.next({ infinite, pagesCount })
|
||||||
offsetPage(true)
|
offsetPage(animated)
|
||||||
})
|
}, { animated })
|
||||||
}
|
}
|
||||||
|
|
||||||
// gestures
|
// gestures
|
||||||
|
|||||||
Reference in New Issue
Block a user