diff --git a/cosmoz-image-viewer.style.js b/cosmoz-image-viewer.style.js
index f801c3d..352e6a2 100644
--- a/cosmoz-image-viewer.style.js
+++ b/cosmoz-image-viewer.style.js
@@ -115,8 +115,13 @@ button.nav:active:not([disabled]) {
cosmoz-slider {
min-height: 150px;
+ overflow-y: auto !important;
height:100%;
- overflow-y: hidden;
}
+cz-spinner {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+}
`;
diff --git a/lib/hooks/use-cosmoz-image-viewer.js b/lib/hooks/use-cosmoz-image-viewer.js
index 5069a7c..a1c3d1e 100644
--- a/lib/hooks/use-cosmoz-image-viewer.js
+++ b/lib/hooks/use-cosmoz-image-viewer.js
@@ -1,11 +1,17 @@
+import '@neovici/cosmoz-utils/elements/cz-spinner';
+
import { useSlideList } from '@neovici/cosmoz-slider';
import { useImperativeApi } from '@neovici/cosmoz-utils/hooks/use-imperative-api';
import { useNotifyProperty } from '@neovici/cosmoz-utils/hooks/use-notify-property';
-import { useCallback, useEffect, useState } from 'haunted';
-import { html } from 'lit-html';
+import { useCallback, useEffect, useMemo, useState } from 'haunted';
+import { html, nothing } from 'lit-html';
import { download } from '../pdf';
import { popout, hasWindow } from '../popout';
import { print } from '../print';
+import { guard } from 'lit-html/directives/guard.js';
+import { until } from 'lit-html/directives/until.js';
+import { invoke } from '@neovici/cosmoz-utils/function';
+import { memoize } from '@neovici/cosmoz-utils/memoize';
const onImageError = (e) => {
if (!e.currentTarget.parentElement) {
@@ -18,21 +24,32 @@ const onImageError = (e) => {
e.currentTarget.setAttribute('hidden', true);
},
onStatusChanged = (ev) => ev.detail.value === 'error' && onImageError(ev),
- renderImage = ({ showZoom, image, isZoomed, _onZoomChanged }) =>
- showZoom
- ? html`