mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-21 22:27:56 +01:00
Migrate src/components/widget/LinkIconTooltip.js to TS
This commit is contained in:
parent
d4fcb859f0
commit
f3170dd11e
@ -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<HTMLElement> {
|
||||
const model = linkIcon.getModel() as LinkModel;
|
||||
const url = model.getUrl();
|
||||
const linkText = `${url}`;
|
||||
|
||||
const result = $('<div></div>').css({
|
||||
@ -54,7 +57,6 @@ class LinkIconTooltip extends FloatingTip {
|
||||
|
||||
link.append(linkText);
|
||||
result.append(link);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user