make sure that the dynamically populated text boxes (with content from NHS) correctly opens links in external windows.
This commit is contained in:
parent
80d3f680a5
commit
bf03a987f3
|
@ -1,5 +1,5 @@
|
||||||
<div *ngIf="!loading else isLoadingTemplate">
|
<div *ngIf="!loading else isLoadingTemplate">
|
||||||
<div [innerHTML]="description"></div>
|
<div [innerHTML]="description" externalLink></div>
|
||||||
<p>Source: <a [href]="url" externalLink>{{source}}</a></p>
|
<p>Source: <a [href]="url" externalLink>{{source}}</a></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -37,10 +37,9 @@ export class ExternalLinkDirective {
|
||||||
onClick(event: MouseEvent) {
|
onClick(event: MouseEvent) {
|
||||||
event.preventDefault();
|
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
|
//check if wails exists and is defined
|
||||||
|
|
||||||
if(typeof wails !== "undefined" && environment.environment_desktop){
|
if(typeof wails !== "undefined" && environment.environment_desktop){
|
||||||
wails.CallByName("pkg.AppService.BrowserOpenURL", url)
|
wails.CallByName("pkg.AppService.BrowserOpenURL", url)
|
||||||
} else{
|
} else{
|
||||||
|
|
Loading…
Reference in New Issue