diff --git a/src/renderer/plugins/image-viewer.tsx b/src/renderer/plugins/image-viewer.tsx index 17e25f4e..9eb8ce0d 100644 --- a/src/renderer/plugins/image-viewer.tsx +++ b/src/renderer/plugins/image-viewer.tsx @@ -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)