Skip to content

Commit

Permalink
Allow additional custom classes on tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
swashbuck committed Sep 10, 2024
1 parent d273e87 commit 24a669c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions js/hotgraphicModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,17 @@ export default class HotgraphicModel extends ItemsComponentModel {
const tooltip = child.get('_tooltip');
if (!tooltip?._isEnabled) return;
tooltip._id = `hotgraphic-pin-${id}-${index}`;
tooltip._classes = (tooltip._classes || '') + ' hotgraphic__pin-tooltip';
const tooltipConfig = {
_isStatic: hasStaticTooltips,
...child.toJSON(),
_classes: [ 'hotgraphic__pin-tooltip' ],
...tooltip
};
tooltipConfig._position = tooltipConfig._position || 'outside bottom middle middle';
const tooltipModel = tooltips.register(tooltipConfig);
child.on('change', () => {
tooltipModel.set({
...child.toJSON(),
_classes: [ 'hotgraphic__pin-tooltip' ],
...tooltip
});
});
Expand Down

0 comments on commit 24a669c

Please sign in to comment.