var $this = this;
var text = '';
+ var css = {};
+ if ($(target).is('[data-tooltip-background]')) {
+ css.backgroundColor = $(target).data('tooltip-background');
+ }
+ if ($(target).is('[data-tooltip-color]')) {
+ css.color = $(target).data('tooltip-color');
+ }
+
if ($(target).is('[data-tooltip]')) {
text = $(target).attr('data-tooltip');
} else if ($(target).is('[data-keyboard-tooltip]')) {
});
}
- this.displayTooltip(text);
+ this.displayTooltip(text, undefined, css);
return false;
},
- displayTooltip: function (text, style) {
+ displayTooltip: function (text, style, css) {
if ($('.fixedTooltip:visible').length > 0) {
return;
}
+ if (css === undefined) {
+ css = {};
+ }
var t = $("#tooltip");
if (style == undefined) {
style = '';
}
t.attr('data-style', style);
- t.css('maxWidth', 250).html(text).show()
+ css.maxWidth = 250;
+ if(css.backgroundColor) {
+ t.get(0).style.setProperty('--background-color', css.backgroundColor);
+ }
+ 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)));
@tooltip-arrows-size: 10px;
position: absolute;
+ --background-color: @tooltip-background;
background-color: @tooltip-background;
+ background-color: var(--background-color);
+
color: @tooltip-color;
top: 0px;
left: 0px;
&[data-style="invert"] {
font-weight: 700;
- background-color: @tooltip-color;
+ --background-color: @tooltip-color;
color: @tooltip-background;
&[data-pos-y="n"] {
&[data-pos-y="n"] {
&:after {
border-bottom: @tooltip-arrows-size solid @tooltip-background;
+ border-bottom: @tooltip-arrows-size solid var(--background-color);
top: unit(@tooltip-arrows-size*-1, px);
}
}
&[data-pos-y="s"] {
&:after {
border-top: @tooltip-arrows-size solid @tooltip-background;
+ border-top: @tooltip-arrows-size solid var(--background-color);
bottom: unit(@tooltip-arrows-size*-1, px);
}
}
.fixedTooltip {
pointer-events: all;
+
a {
position: relative;
- top:-3px;
+ top: -3px;
margin-right: 25px;
display: inline-block;
text-transform: uppercase;
+
svg {
height: 19px;
width: auto;