mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-22 20:31:13 +00:00
Fixing image in newtab. Fixes #382
This commit is contained in:
parent
bf93e29f4c
commit
c50b7fc7fd
1 changed files with 9 additions and 7 deletions
|
@ -203,16 +203,16 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
|
|
||||||
if (isImage(post.url)) {
|
if (isImage(post.url)) {
|
||||||
return (
|
return (
|
||||||
<div
|
<a
|
||||||
class="float-right text-body pointer d-inline-block position-relative mb-2"
|
href={this.getImageSrc()}
|
||||||
|
class="float-right text-body d-inline-block position-relative mb-2"
|
||||||
data-tippy-content={i18n.t("expand_here")}
|
data-tippy-content={i18n.t("expand_here")}
|
||||||
onClick={linkEvent(this, this.handleImageExpandClick)}
|
onClick={linkEvent(this, this.handleImageExpandClick)}
|
||||||
role="button"
|
|
||||||
aria-label={i18n.t("expand_here")}
|
aria-label={i18n.t("expand_here")}
|
||||||
>
|
>
|
||||||
{this.imgThumb(this.getImageSrc())}
|
{this.imgThumb(this.getImageSrc())}
|
||||||
<Icon icon="image" classes="mini-overlay" />
|
<Icon icon="image" classes="mini-overlay" />
|
||||||
</div>
|
</a>
|
||||||
);
|
);
|
||||||
} else if (post.thumbnail_url) {
|
} else if (post.thumbnail_url) {
|
||||||
return (
|
return (
|
||||||
|
@ -419,12 +419,13 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
<Icon icon="minus-square" classes="icon-inline" />
|
<Icon icon="minus-square" classes="icon-inline" />
|
||||||
</button>
|
</button>
|
||||||
<div>
|
<div>
|
||||||
<button
|
<a
|
||||||
|
href={this.getImageSrc()}
|
||||||
class="btn btn-link d-inline-block"
|
class="btn btn-link d-inline-block"
|
||||||
onClick={linkEvent(this, this.handleImageExpandClick)}
|
onClick={linkEvent(this, this.handleImageExpandClick)}
|
||||||
>
|
>
|
||||||
<PictrsImage src={this.getImageSrc()} />
|
<PictrsImage src={this.getImageSrc()} />
|
||||||
</button>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
))}
|
))}
|
||||||
|
@ -1542,7 +1543,8 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
i.setState(i.state);
|
i.setState(i.state);
|
||||||
}
|
}
|
||||||
|
|
||||||
handleImageExpandClick(i: PostListing) {
|
handleImageExpandClick(i: PostListing, event: any) {
|
||||||
|
event.preventDefault();
|
||||||
i.state.imageExpanded = !i.state.imageExpanded;
|
i.state.imageExpanded = !i.state.imageExpanded;
|
||||||
i.setState(i.state);
|
i.setState(i.state);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue