mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-18 18:39:55 +00:00
fixed #7755 - prevent release notes links from navigating away
This commit is contained in:
parent
c57a7e73ea
commit
24f8a4bd43
@ -1,4 +1,5 @@
|
|||||||
import { Directive, Input, ElementRef, OnChanges } from '@angular/core'
|
import { Directive, Input, ElementRef, OnChanges } from '@angular/core'
|
||||||
|
import { PlatformService } from '../api/platform'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Directive({
|
@Directive({
|
||||||
@ -6,9 +7,19 @@ import { Directive, Input, ElementRef, OnChanges } from '@angular/core'
|
|||||||
})
|
})
|
||||||
export class FastHtmlBindDirective implements OnChanges {
|
export class FastHtmlBindDirective implements OnChanges {
|
||||||
@Input() fastHtmlBind: string
|
@Input() fastHtmlBind: string
|
||||||
constructor (private el: ElementRef) { }
|
|
||||||
|
constructor (
|
||||||
|
private el: ElementRef,
|
||||||
|
private platform: PlatformService,
|
||||||
|
) { }
|
||||||
|
|
||||||
ngOnChanges (): void {
|
ngOnChanges (): void {
|
||||||
this.el.nativeElement.innerHTML = this.fastHtmlBind || ''
|
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…
x
Reference in New Issue
Block a user