|
|
|
@ -27,6 +27,7 @@ export class HyperlinkParticle {
|
|
|
|
hyperlinkPopupContainer.classList.add(`${EDITOR_PREFIX}-hyperlink-popup`)
|
|
|
|
hyperlinkPopupContainer.classList.add(`${EDITOR_PREFIX}-hyperlink-popup`)
|
|
|
|
const hyperlinkDom = document.createElement('a')
|
|
|
|
const hyperlinkDom = document.createElement('a')
|
|
|
|
hyperlinkDom.target = '_blank'
|
|
|
|
hyperlinkDom.target = '_blank'
|
|
|
|
|
|
|
|
hyperlinkDom.rel = 'noopener'
|
|
|
|
hyperlinkPopupContainer.append(hyperlinkDom)
|
|
|
|
hyperlinkPopupContainer.append(hyperlinkDom)
|
|
|
|
this.container.append(hyperlinkPopupContainer)
|
|
|
|
this.container.append(hyperlinkPopupContainer)
|
|
|
|
return { hyperlinkPopupContainer, hyperlinkDom }
|
|
|
|
return { hyperlinkPopupContainer, hyperlinkDom }
|
|
|
|
@ -51,6 +52,13 @@ export class HyperlinkParticle {
|
|
|
|
this.hyperlinkPopupContainer.style.display = 'none'
|
|
|
|
this.hyperlinkPopupContainer.style.display = 'none'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public openHyperlink(element: IElement) {
|
|
|
|
|
|
|
|
const newTab = window.open(element.url, '_blank')
|
|
|
|
|
|
|
|
if (newTab) {
|
|
|
|
|
|
|
|
newTab.opener = null
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public render(ctx: CanvasRenderingContext2D, element: IRowElement, x: number, y: number) {
|
|
|
|
public render(ctx: CanvasRenderingContext2D, element: IRowElement, x: number, y: number) {
|
|
|
|
ctx.save()
|
|
|
|
ctx.save()
|
|
|
|
ctx.font = element.style
|
|
|
|
ctx.font = element.style
|
|
|
|
|