Add Callback to bootstrap popover
/* override bootstrap popover to include callback */
var showPopover = $.fn.popover.Constructor.prototype.show;
$.fn.popover.Constructor.prototype.show = function() {
showPopover.call(this);
if (this.options.showCallback) {
this.options.showCallback.call(this);
}
}
var hidePopover = $.fn.popover.Constructor.prototype.hide;
$.fn.popover.Constructor.prototype.hide = function() {
if (this.options.hideCallback) {
this.options.hideCallback.call(this);
}
hidePopover.call(this);
}
/* usage */
/*
$('#example').popover({
showCallback : function() {
console.log('popover is shown');
},
hideCallback : function() {
console.log('popover is hidden');
}
});
*/