Custom bootstrap tooltip with separate styles and directive (#345)

* Launch application scancodes (closes #328)

* simple directive to map bootstrap tooltip, add sample usage

* Custom bootstrap tooltip with separate styles and directive (closes #329)

* fix: linting issues

* fix: try to ignore stylelint for !important

* review: simple tooltip with html content and custom styles

* cleanup extra html tags for tooltip sample
This commit is contained in:
Attila Csanyi
2017-07-11 17:04:31 +02:00
committed by László Monda
parent e57a2f8637
commit 6271802bbc
10 changed files with 1434 additions and 3689 deletions

View File

@@ -1 +1,2 @@
export * from './cancelable';
export * from './tooltip';

View File

@@ -0,0 +1 @@
export { TooltipDirective } from './tooltip.directive';

View File

@@ -0,0 +1,25 @@
import { Directive, ElementRef, AfterContentInit, Renderer2 } from '@angular/core';
@Directive({
selector: '[data-toggle="tooltip"]'
})
export class TooltipDirective implements AfterContentInit {
private customTooltipTemplate = `
<div class="tooltip">
<div class="tooltip-arrow"></div>
<div class="tooltip-inner"></div>
</div>
`;
constructor(private elementRef: ElementRef, private renderer: Renderer2) { }
ngAfterContentInit() {
jQuery(this.elementRef.nativeElement).tooltip({
placement: 'top',
html: true,
template: this.customTooltipTemplate
});
}
}