From bf03a987f39bd270cf922fdae47ba6762863ee3f Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Wed, 6 Sep 2023 18:49:37 -0700 Subject: [PATCH] make sure that the dynamically populated text boxes (with content from NHS) correctly opens links in external windows. --- .../components/glossary-lookup/glossary-lookup.component.html | 2 +- frontend/src/app/directives/external-link.directive.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/components/glossary-lookup/glossary-lookup.component.html b/frontend/src/app/components/glossary-lookup/glossary-lookup.component.html index c45c2cf2..91c1bac7 100644 --- a/frontend/src/app/components/glossary-lookup/glossary-lookup.component.html +++ b/frontend/src/app/components/glossary-lookup/glossary-lookup.component.html @@ -1,5 +1,5 @@
-
+

Source: {{source}}

diff --git a/frontend/src/app/directives/external-link.directive.ts b/frontend/src/app/directives/external-link.directive.ts index 203e5e67..e6574b98 100644 --- a/frontend/src/app/directives/external-link.directive.ts +++ b/frontend/src/app/directives/external-link.directive.ts @@ -37,10 +37,9 @@ export class ExternalLinkDirective { onClick(event: MouseEvent) { event.preventDefault(); - let url: string = (event.currentTarget).getAttribute("href"); + let url: string = (event.currentTarget).getAttribute("href") || (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{