diff options
Diffstat (limited to 'js/src')
| -rw-r--r-- | js/src/tooltip.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/js/src/tooltip.js b/js/src/tooltip.js index b2495a3e1..368e04b30 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -54,6 +54,7 @@ const DefaultType = { container: '(string|element|boolean)', fallbackPlacement: '(string|array)', boundary: '(string|element)', + customClass: '(string|function)', sanitize: 'boolean', sanitizeFn: '(null|function)', allowList: 'object', @@ -83,6 +84,7 @@ const Default = { container: false, fallbackPlacement: 'flip', boundary: 'scrollParent', + customClass: '', sanitize: true, sanitizeFn: null, allowList: DefaultAllowlist, @@ -296,6 +298,11 @@ class Tooltip { tip.classList.add(CLASS_NAME_SHOW) + const customClass = typeof this.config.customClass === 'function' ? this.config.customClass() : this.config.customClass + if (customClass) { + tip.classList.add(...customClass.split(' ')) + } + // If this is a touch-enabled device we add extra // empty mouseover listeners to the body's immediate children; // only needed because of broken event delegation on iOS |
