]> _ Git - fluidbook-html5.git/commitdiff
wait #5212 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 5 Apr 2022 10:07:53 +0000 (12:07 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 5 Apr 2022 10:07:53 +0000 (12:07 +0200)
js/libs/fluidbook/fluidbook.tooltip.js

index ce1ed7c66b997cce501dbdf35ea19693a675b4a0..213770e79a60f0e866b265d374240d353e7f1c10 100644 (file)
@@ -173,7 +173,8 @@ FluidbookTooltip.prototype = {
             style = '';
         }
         t.attr('data-style', style);
-        css.maxWidth = 250;
+        var tooltipMaxWidth=Math.max(250,this.fluidbook.settings.linkTooltipMaxWidth);
+        css.maxWidth = tooltipMaxWidth;
         if (Modernizr.cssvars) {
             if (css.backgroundColor) {
                 t.get(0).style.setProperty('--background-color', css.backgroundColor);
@@ -190,7 +191,7 @@ FluidbookTooltip.prototype = {
         t.css(css).html(text).show();
 
         var nbchars = t.text().length;
-        var maxWidth = Math.min(this.fluidbook.resize.ww, Math.max(250, Math.min(750, nbchars * 1.2)));
+        var maxWidth = Math.min(this.fluidbook.resize.ww, Math.max(tooltipMaxWidth, Math.min(750, nbchars * 1.2)));
 
         for (var w = 250; w <= maxWidth; w += 25) {
             if ((t.height() * 1.5) > t.width()) {