mirror of
https://github.com/Eugeny/tabby
synced 2024-11-15 01:17:14 +00:00
fixed #7755 - prevent release notes links from navigating away
This commit is contained in:
parent
c57a7e73ea
commit
24f8a4bd43
1 changed files with 12 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
import { Directive, Input, ElementRef, OnChanges } from '@angular/core'
|
||||
import { PlatformService } from '../api/platform'
|
||||
|
||||
/** @hidden */
|
||||
@Directive({
|
||||
|
@ -6,9 +7,19 @@ import { Directive, Input, ElementRef, OnChanges } from '@angular/core'
|
|||
})
|
||||
export class FastHtmlBindDirective implements OnChanges {
|
||||
@Input() fastHtmlBind: string
|
||||
constructor (private el: ElementRef) { }
|
||||
|
||||
constructor (
|
||||
private el: ElementRef,
|
||||
private platform: PlatformService,
|
||||
) { }
|
||||
|
||||
ngOnChanges (): void {
|
||||
this.el.nativeElement.innerHTML = this.fastHtmlBind || ''
|
||||
for (const link of this.el.nativeElement.querySelectorAll('a')) {
|
||||
link.addEventListener('click', event => {
|
||||
event.preventDefault()
|
||||
this.platform.openExternal(link.href)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue