sibanu_web/public/assets/js/components/init/popover.js

40 lines
615 B
JavaScript
Raw Normal View History

2022-08-20 13:21:23 +07:00
//
// Popover
//
'use strict';
var Popover = (function() {
// Variables
var $popover = $('[data-toggle="popover"]'),
$popoverClass = '';
// Methods
function init($this) {
if ($this.data('color')) {
$popoverClass = 'popover-' + $this.data('color');
}
var options = {
trigger: 'focus',
template: '<div class="popover ' + $popoverClass + '" role="tooltip"><div class="arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>'
};
$this.popover(options);
}
// Events
if ($popover.length) {
$popover.each(function() {
init($(this));
});
}
})();