mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-20 11:00:52 +08:00
This commit is contained in:
parent
b3b1f3e6a5
commit
a5dcf0827f
@ -19,6 +19,14 @@ export const previewImage = (src: string, id: string) => {
|
||||
imagesElement.innerHTML = html;
|
||||
// @ts-ignore
|
||||
const viewer = new Viewer(imagesElement, {
|
||||
title: [1, (image: HTMLImageElement, imageData: IObject) => {
|
||||
let name = image.alt;
|
||||
if (!name) {
|
||||
name = image.src.substring(image.src.lastIndexOf("/") + 1);
|
||||
}
|
||||
name = name.substring(0, name.lastIndexOf(".")).replace(/-\d{14}-\w{7}$/, "");
|
||||
return `${name} [${imageData.naturalWidth} × ${imageData.naturalHeight}]`;
|
||||
}],
|
||||
button: false,
|
||||
initialViewIndex,
|
||||
transition: false,
|
||||
|
Loading…
Reference in New Issue
Block a user