feat: allow wider tooltip width than parent container

This commit is contained in:
Róbert Kiss
2018-06-18 23:30:27 +02:00
parent cabfde7963
commit 63a936968d
2 changed files with 7 additions and 5 deletions

View File

@@ -95,7 +95,7 @@
<icon name="question-circle"
data-toggle="tooltip"
html="true"
maxWidth="500"
maxWidth="525"
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>Remap on all keymaps</strong>: Remap key on the current layer of all keymaps.</li>

View File

@@ -47,15 +47,17 @@ export class TooltipDirective implements AfterContentInit, OnChanges {
}
private getCustomTemplate(): string {
let style = '';
let tooltipStyle = '';
let innerStyle = '';
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-inner" ${style}></div>
<div class="tooltip-inner" ${innerStyle}></div>
</div>`;
}
}