feat: allow wider tooltip width than parent container (#682)
This commit is contained in:
committed by
László Monda
parent
cabfde7963
commit
f52dc36a6a
@@ -95,7 +95,7 @@
|
|||||||
<icon name="question-circle"
|
<icon name="question-circle"
|
||||||
data-toggle="tooltip"
|
data-toggle="tooltip"
|
||||||
html="true"
|
html="true"
|
||||||
maxWidth="500"
|
maxWidth="525"
|
||||||
title="<ul class='no-indent text-left'>
|
title="<ul class='no-indent text-left'>
|
||||||
<li><strong>Default behavior</strong>: Remap the key on the the current layer of the current keymap.</li>
|
<li><strong>Default behavior</strong>: Remap the key on the the current layer of the current keymap.</li>
|
||||||
<li><strong>Remap on all keymaps</strong>: Remap key on the current layer of all keymaps.</li>
|
<li><strong>Remap on all keymaps</strong>: Remap key on the current layer of all keymaps.</li>
|
||||||
|
|||||||
@@ -47,15 +47,17 @@ export class TooltipDirective implements AfterContentInit, OnChanges {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private getCustomTemplate(): string {
|
private getCustomTemplate(): string {
|
||||||
let style = '';
|
let tooltipStyle = '';
|
||||||
|
let innerStyle = '';
|
||||||
|
|
||||||
if (this.maxWidth) {
|
if (this.maxWidth) {
|
||||||
style = `style="max-width: ${this.maxWidth}px;"`;
|
tooltipStyle = `style="width: ${this.maxWidth}px;"`;
|
||||||
|
innerStyle = `style="max-width: ${this.maxWidth}px;"`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return `<div class="tooltip">
|
return `<div class="tooltip" ${tooltipStyle}>
|
||||||
<div class="tooltip-arrow"></div>
|
<div class="tooltip-arrow"></div>
|
||||||
<div class="tooltip-inner" ${style}></div>
|
<div class="tooltip-inner" ${innerStyle}></div>
|
||||||
</div>`;
|
</div>`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user