20 lines
686 B
JavaScript
Executable File
20 lines
686 B
JavaScript
Executable File
import tippy from 'tippy.js';
|
|
import 'tippy.js/dist/tippy.css';
|
|
|
|
export default function($) {
|
|
$.fn.tt = function({ prefix, container }) {
|
|
var color = $(this).data('bg') ? $(this).data('bg') : 'default';
|
|
var placement = $(this).data('placement') ? $(this).data('placement') : 'top';
|
|
|
|
return new Tooltip(this, {
|
|
placement: placement,
|
|
html: true,
|
|
container: 'body',
|
|
template: `<div class="${prefix}tooltip ${prefix}tooltip-${color} ${prefix}p-3" role="tooltip">
|
|
<div class="${prefix}tooltip-arrow"></div>
|
|
<div class="tooltip-inner"></div>
|
|
</div>`
|
|
});
|
|
};
|
|
};
|