mirror of
https://github.com/purocean/yn.git
synced 2026-09-24 15:46:02 +08:00
feat(image-viewer): hide navbar when we have too many images
This commit is contained in:
@@ -114,6 +114,14 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
const _initList = (viewer as any).initList
|
||||
;(viewer as any).initList = function (this: any, ...args: any[]) {
|
||||
// hack for viewerjs, when there are too many images, the navbar will be hidden
|
||||
this.options.navbar = this.images.length <= 5
|
||||
this.navbar.style.display = this.options.navbar ? 'block' : 'none'
|
||||
return _initList.apply(viewer, args)
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
viewer.bind = wrapEventBind(viewer.bind)
|
||||
|
||||
Reference in New Issue
Block a user