Comparing version 1.5.0 to 1.6.0
{ | ||
"name": "tooltip", | ||
"version": "1.5.0", | ||
"version": "1.6.0", | ||
"description": "Tooltip manager", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -44,2 +44,3 @@ # Tooltip | ||
* hiddenStyle - style to be applied to the tooltip element when it is hidden | ||
* appendTooltip: Function - a function to append the tooltip (defaults to doing `document.body.appendChild(tooltipElement)` ) | ||
* offset - defaults to { x: 5, y: 5 } | ||
@@ -46,0 +47,0 @@ * attrName - defaults to `"data-tooltip"`. Tooltip will show on hover over elements with this attribute. |
@@ -13,3 +13,8 @@ 'use strict'; | ||
element.className = config.className | ||
document.body.appendChild(element) | ||
if (config.appendTooltip){ | ||
config.appendTooltip(element) | ||
} else { | ||
document.body.appendChild(element) | ||
} | ||
map[config.id] = element | ||
@@ -16,0 +21,0 @@ } |
165081
4056
52