forked from mystiq/hydrogen-web
disable click-to-zoom on image
so we can release before the lightbox ix ready
This commit is contained in:
parent
b69464b87d
commit
0405af0116
1 changed files with 2 additions and 14 deletions
|
@ -27,12 +27,10 @@ export class ImageView extends TemplateView {
|
||||||
width: vm.thumbnailWidth,
|
width: vm.thumbnailWidth,
|
||||||
height: vm.thumbnailHeight,
|
height: vm.thumbnailHeight,
|
||||||
loading: "lazy",
|
loading: "lazy",
|
||||||
alt: vm.label,
|
alt: vm => vm.label,
|
||||||
|
title: vm => vm.label,
|
||||||
});
|
});
|
||||||
const linkContainer = t.a({
|
const linkContainer = t.a({
|
||||||
href: "#",
|
|
||||||
onClick: evt => this.openImage(evt),
|
|
||||||
target: "_blank",
|
|
||||||
style: `padding-top: ${heightRatioPercent}%; width: ${vm.thumbnailWidth}px;`
|
style: `padding-top: ${heightRatioPercent}%; width: ${vm.thumbnailWidth}px;`
|
||||||
}, image);
|
}, image);
|
||||||
|
|
||||||
|
@ -40,14 +38,4 @@ export class ImageView extends TemplateView {
|
||||||
[t.div(linkContainer), t.p(t.time(vm.date + " " + vm.time))]
|
[t.div(linkContainer), t.p(t.time(vm.date + " " + vm.time))]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async openImage(evt) {
|
|
||||||
const link = evt.currentTarget;
|
|
||||||
if (link.getAttribute("href") === "#") {
|
|
||||||
evt.preventDefault();
|
|
||||||
const url = await this.value.loadImageUrl();
|
|
||||||
link.setAttribute("href", url);
|
|
||||||
link.click();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue