X-Git-Url: http://these/git/?a=blobdiff_plain;f=src%2Fshared%2Fcomponents%2Fpost%2Fpost-listing.tsx;h=c92663501e474ecae19526a25c55a2f089e3c3ef;hb=2efe167f6d5f5cb65a2b749ba2fcee0934b247a3;hp=afd5daa5cdfb55a84ee815a066d3965da628b96d;hpb=ff62915ddfa2492ab3889d8465b530c1d57f59dd;p=lemmy-ui.git diff --git a/src/shared/components/post/post-listing.tsx b/src/shared/components/post/post-listing.tsx index afd5daa..c926635 100644 --- a/src/shared/components/post/post-listing.tsx +++ b/src/shared/components/post/post-listing.tsx @@ -349,6 +349,7 @@ export class PostListing extends Component { href={url} rel={relTags} title={url} + target={this.linkTarget} > {this.imgThumb(this.imageSrc)} { data-tippy-content={I18NextService.i18n.t("expand_here")} onClick={linkEvent(this, this.handleImageExpandClick)} aria-label={I18NextService.i18n.t("expand_here")} + target={this.linkTarget} >
@@ -376,7 +378,13 @@ export class PostListing extends Component { ); } else { return ( - +
@@ -389,6 +397,7 @@ export class PostListing extends Component { className="text-body" to={`/post/${post.id}`} title={I18NextService.i18n.t("comments")} + target={this.linkTarget} >
@@ -737,6 +746,14 @@ export class PostListing extends Component { ); } + public get linkTarget(): string { + return UserService.Instance.myUserInfo?.local_user_view.local_user + .open_links_in_new_tab + ? "_blank" + : // _self is the default target on links when the field is not specified + "_self"; + } + get commentsButton() { const post_view = this.postView; const title = I18NextService.i18n.t("number_of_comments", { @@ -750,6 +767,7 @@ export class PostListing extends Component { title={title} to={`/post/${post_view.post.id}?scrollToComments=true`} data-tippy-content={title} + target={this.linkTarget} > {post_view.counts.comments}