From c451e619727c6af186cfb42b0796e5100beb7d66 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Sun, 5 Dec 2021 11:47:27 +0100 Subject: [PATCH] CombodoTooltip: Add option to define max. width of the tooltip --- js/utils.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/utils.js b/js/utils.js index 5fcb5f7cd..22b8ac862 100644 --- a/js/utils.js +++ b/js/utils.js @@ -849,6 +849,12 @@ const CombodoTooltip = { oOptions['appendTo'] = mAppendTo; } + // Max. width overload + const sMaxWidth = oElem.attr('data-tooltip-max-width'); + if ((sMaxWidth !== undefined) && (sMaxWidth !== '')) { + oOptions['maxWidth'] = sMaxWidth; + } + oOptions['placement'] = oElem.attr('data-tooltip-placement') ?? 'top'; oOptions['trigger'] = oElem.attr('data-tooltip-trigger') ?? 'mouseenter focus';