Skip to content

Commit 82af74a

Browse files
committed
Put size into tooltip
Signed-off-by: Liam Barry Allan <[email protected]>
1 parent 1f9a32b commit 82af74a

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/render.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ module.exports = class Render {
125125
const content = this.getHTML(format);
126126
css += content.css;
127127
body += content.body;
128+
body += `</div>`;
128129

129130
return [
130131
`<html style="zoom: ${props.zoom};">`,
@@ -580,15 +581,12 @@ module.exports = class Render {
580581
break;
581582
}
582583

583-
let hoverText;
584+
let displayName = (field.displayType === `const` ?
585+
`Constant` :
586+
(field.name.includes(`_0`) ? field.name.substring(0, field.name.indexOf(`_0`)) : field.name))
584587

585-
if (field.displayType !== `const`) {
586-
// Remove unique subfield names
587-
const displayName = field.name.includes(`_0`) ? field.name.substring(0, field.name.indexOf(`_0`)) : field.name;
588-
589-
const textKeyword = keywords.find(keyword => keyword.name === `TEXT`);
590-
hoverText = `${displayName} ${textKeyword ? textKeyword.value : ``}`.trim();
591-
}
588+
const textKeyword = keywords.find(keyword => keyword.name === `TEXT`);
589+
const hoverText = `${displayName} (${field.position.y}, ${field.position.x}) ${textKeyword ? textKeyword.value : ``}`.trim();
592590

593591
let body = `<div id="${htmlName}">${hoverText ? `<div id="${htmlName}_tooltip">${hoverText}</div>` : ``}${value.padEnd(length, padString)}</div>`
594592

0 commit comments

Comments
 (0)