Skip to content

Commit

Permalink
fixed ctrl+click on user follow links to properly open in a browser t…
Browse files Browse the repository at this point in the history
…ab (#494)
  • Loading branch information
sei-aschlackman authored Jun 6, 2024
1 parent be8b10b commit 9f8d0d5
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/app/components/user-list/team-users/team-users.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,22 +148,26 @@ export class TeamUsersComponent implements AfterViewInit {
window.open(this.getFollowUrl(user), '_blank');
}

public openUserHere($event, user: VmUser) {
$event.preventDefault();
const url = this.getFollowUrl(user);
const val = <{ [name: string]: string }>{ name: user.username, url };
this.openTab.emit(val);
public openUserHere(event: MouseEvent, user: VmUser) {
if (!event.ctrlKey) {
event.preventDefault();
const url = this.getFollowUrl(user);
const val = <{ [name: string]: string }>{ name: user.username, url };
this.openTab.emit(val);
}
}

public openInTab(url: string) {
window.open(this.getThemedUrl(url), '_blank');
}

public openVmHere($event, url: string, tabName: string) {
$event.preventDefault();
const vmUrl = this.getVmUrl(url);
const val = <{ [name: string]: string }>{ name: tabName, url: vmUrl };
this.openTab.emit(val);
public openVmHere(event: MouseEvent, url: string, tabName: string) {
if (!event.ctrlKey) {
event.preventDefault();
const vmUrl = this.getVmUrl(url);
const val = <{ [name: string]: string }>{ name: tabName, url: vmUrl };
this.openTab.emit(val);
}
}

public getFollowUrl(user: VmUser) {
Expand Down

0 comments on commit 9f8d0d5

Please sign in to comment.