more middle click handling

This commit is contained in:
Nicolas Constant 2019-07-06 01:28:30 -04:00
parent 020fbd9de3
commit 394fe508a1
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
5 changed files with 25 additions and 5 deletions

View File

@ -23,11 +23,17 @@
<fa-icon class="followed" [icon]="faUserPlus"></fa-icon>
</div>
<div class="stream__notification--label">
<a href class="stream__link" (click)="openAccount(notification.account)" innerHTML="{{ notification.account | accountEmoji }}"></a> followed
<a href class="stream__link"
(click)="openAccount(notification.account)"
(auxclick)="openUrl(notification.account.url)"
innerHTML="{{ notification.account | accountEmoji }}"></a> followed
you!
</div>
<a href (click)="openAccount(notification.account)" class="follow-account" title="{{notification.account.acct}}">
<a href
(click)="openAccount(notification.account)"
(auxclick)="openUrl(notification.account.url)"
class="follow-account" title="{{notification.account.acct}}">
<img class="follow-account__avatar" src="{{ notification.account.avatar }}" />
<span class="follow-account__display-name" innerHTML="{{ notification.account | accountEmoji }}"></span>
<span class="follow-account__acct">@{{ notification.account.acct }}</span>

View File

@ -134,6 +134,11 @@ export class NotificationsComponent implements OnInit, OnDestroy {
return false;
}
openUrl(url: string): boolean {
window.open(url, '_blank');
return false;
}
browseAccount(accountName: string): void {
this.browseAccountEvent.next(accountName);
}

View File

@ -9,7 +9,9 @@
<fa-icon class="favorite" [icon]="faStar"></fa-icon>
</div>
<div class="notification--label">
<a href class="notification--link" (click)="openAccount(notificationAccount)"
<a href class="notification--link" title="open account"
(click)="openAccount(notificationAccount)"
(auxclick)="openUrl(notificationAccount.url)"
innerHTML="{{ notificationAccount | accountEmoji }}"></a> favorited your status
</div>
</div>
@ -18,7 +20,9 @@
<fa-icon class="boost" [icon]="faRetweet"></fa-icon>
</div>
<div class="notification--label">
<a href class="notification--link" (click)="openAccount(notificationAccount)"
<a href class="notification--link" title="open account"
(click)="openAccount(notificationAccount)"
(auxclick)="openUrl(notificationAccount.url)"
innerHTML="{{ notificationAccount | accountEmoji }}"></a> boosted your status
</div>
</div>

View File

@ -5,7 +5,7 @@
<div *ngIf="displayedAccount" class="profile-header"
[ngStyle]="{'background-image':'url('+displayedAccount.header+')'}">
<div class="profile-header__inner">
<a href (click)="showAvatar(displayedAccount.avatar)" title="open avatar">
<a href (click)="showAvatar(displayedAccount.avatar)" (auxclick)="openAccount()" title="open avatar">
<img class="profile-header__avatar" src="{{displayedAccount.avatar}}" alt="header" />
</a>
<h2 class="profile-header__display-name" innerHTML="{{displayedAccount | accountEmoji }}"></h2>

View File

@ -273,4 +273,9 @@ export class UserProfileComponent implements OnInit {
this.maxId = this.statuses[this.statuses.length - 1].status.id;
}
openAccount(): boolean {
window.open(this.displayedAccount.url, '_blank');
return false;
}
}