feat(image-viewer): hide navbar when we have too many images

This commit is contained in:
purocean
2024-05-14 15:05:55 +08:00
parent 20b0de4707
commit e75da9cfdc
+8
View File
@@ -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)