Skip to content

Commit

Permalink
make sure that the dynamically populated text boxes (with content fro…
Browse files Browse the repository at this point in the history
…m NHS) correctly opens links in external windows.
  • Loading branch information
AnalogJ committed Sep 7, 2023
1 parent 80d3f68 commit bf03a98
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div *ngIf="!loading else isLoadingTemplate">
<div [innerHTML]="description"></div>
<div [innerHTML]="description" externalLink></div>
<p>Source: <a [href]="url" externalLink>{{source}}</a></p>
</div>

Expand Down
3 changes: 1 addition & 2 deletions frontend/src/app/directives/external-link.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ export class ExternalLinkDirective {
onClick(event: MouseEvent) {
event.preventDefault();

let url: string = (<any>event.currentTarget).getAttribute("href");
let url: string = (<any>event.currentTarget).getAttribute("href") || (<any>event.target).getAttribute("href");

//check if wails exists and is defined

if(typeof wails !== "undefined" && environment.environment_desktop){
wails.CallByName("pkg.AppService.BrowserOpenURL", url)
} else{
Expand Down

0 comments on commit bf03a98

Please sign in to comment.