mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
refactor: set global defaults of vue-scrollto
This commit is contained in:
parent
db1bcdd3d2
commit
08e73747bd
@ -145,7 +145,7 @@ describe('Comment.vue', () => {
|
|||||||
it('calls $scrollTo', () => {
|
it('calls $scrollTo', () => {
|
||||||
wrapper = Wrapper()
|
wrapper = Wrapper()
|
||||||
jest.runAllTimers()
|
jest.runAllTimers()
|
||||||
expect(mocks.$scrollTo).toHaveBeenCalledWith('#commentId-2', 1000)
|
expect(mocks.$scrollTo).toHaveBeenCalledWith('#commentId-2')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -103,7 +103,7 @@ describe('CommentList.vue', () => {
|
|||||||
it('calls $scrollTo', () => {
|
it('calls $scrollTo', () => {
|
||||||
wrapper = Wrapper()
|
wrapper = Wrapper()
|
||||||
jest.runAllTimers()
|
jest.runAllTimers()
|
||||||
expect(mocks.$scrollTo).toHaveBeenCalledWith('#comments', 1000)
|
expect(mocks.$scrollTo).toHaveBeenCalledWith('#comments')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -5,7 +5,7 @@ function scrollToAnchor(anchor, { checkAnchor, $scrollTo }) {
|
|||||||
)
|
)
|
||||||
if (!checkAnchor(anchor)) return
|
if (!checkAnchor(anchor)) return
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
$scrollTo(anchor, 1000)
|
$scrollTo(anchor)
|
||||||
}, 250)
|
}, 250)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -142,7 +142,13 @@ export default {
|
|||||||
keys: envWhitelist,
|
keys: envWhitelist,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
[
|
||||||
'vue-scrollto/nuxt',
|
'vue-scrollto/nuxt',
|
||||||
|
{
|
||||||
|
offset: -100, // to compensate fixed navbar height
|
||||||
|
duration: 1000,
|
||||||
|
},
|
||||||
|
],
|
||||||
'cookie-universal-nuxt',
|
'cookie-universal-nuxt',
|
||||||
'@nuxtjs/apollo',
|
'@nuxtjs/apollo',
|
||||||
'@nuxtjs/axios',
|
'@nuxtjs/axios',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user