From f3170dd11e8ab63a8966fd1a23a801243873e559 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 21 Jun 2022 20:29:02 -0700 Subject: [PATCH] Migrate src/components/widget/LinkIconTooltip.js to TS --- .../widget/{LinkIconTooltip.js => LinkIconTooltip.ts} | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) rename packages/mindplot/src/components/widget/{LinkIconTooltip.js => LinkIconTooltip.ts} (88%) diff --git a/packages/mindplot/src/components/widget/LinkIconTooltip.js b/packages/mindplot/src/components/widget/LinkIconTooltip.ts similarity index 88% rename from packages/mindplot/src/components/widget/LinkIconTooltip.js rename to packages/mindplot/src/components/widget/LinkIconTooltip.ts index 7e079263..440ac955 100644 --- a/packages/mindplot/src/components/widget/LinkIconTooltip.js +++ b/packages/mindplot/src/components/widget/LinkIconTooltip.ts @@ -17,11 +17,13 @@ */ import { $assert } from '@wisemapping/core-js'; import $ from 'jquery'; +import LinkIcon from '../LinkIcon'; +import LinkModel from '../model/LinkModel'; import { $msg } from '../Messages'; import FloatingTip from './FloatingTip'; class LinkIconTooltip extends FloatingTip { - constructor(linkIcon) { + constructor(linkIcon: LinkIcon) { $assert(linkIcon, 'linkIcon can not be null'); const nativeElement = $(linkIcon.getImage().peer._native); super(nativeElement, { @@ -38,8 +40,9 @@ class LinkIconTooltip extends FloatingTip { }); } - static _buildContent(linkIcon) { - const url = linkIcon.getModel().getUrl(); + private static _buildContent(linkIcon: LinkIcon): JQuery { + const model = linkIcon.getModel() as LinkModel; + const url = model.getUrl(); const linkText = `${url}`; const result = $('
').css({ @@ -54,7 +57,6 @@ class LinkIconTooltip extends FloatingTip { link.append(linkText); result.append(link); - return result; } }