1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

fixed minimal image height

This commit is contained in:
Fedor Katurov 2019-12-02 12:41:46 +07:00
parent 408c09d795
commit 5e9fed4124

View file

@ -103,8 +103,10 @@ const NodeImageSlideBlock: FC<IProps> = ({ node, is_loading, updateLayout }) =>
return () => clearTimeout(timeout); return () => clearTimeout(timeout);
} }
const prev = Math.max(heights[Math.floor(selected)] || fallback, fallback); const minimal = Math.min(fallback, 120);
const next = Math.max(heights[Math.ceil(selected)] || fallback, fallback);
const prev = Math.max(heights[Math.floor(selected)] || fallback, minimal);
const next = Math.max(heights[Math.ceil(selected)] || fallback, minimal);
const now = prev - (prev - next) * (selected % 1); const now = prev - (prev - next) * (selected % 1);
if (current !== Math.round(selected)) setCurrent(Math.round(selected)); if (current !== Math.round(selected)) setCurrent(Math.round(selected));