When I use the bootstrap popover in 'manual' mode 'destroy' and 'hide' not working properly. When I'm using hide and destroy, popover opacity changing to 0 but its not changing display to none, which resulting that the popover container cover the content bellow it. Otherwise if I use 'toogle' mode it's working properly.
My code:
$('[rel="popover"]').popover({
html: true,
placement: 'auto',
container: 'body',
trigger: 'manual'
});
$('body').on('click' , '[rel="popover"]' , function(e){
e.stopPropagation();
$(this).popover('toggle');
});
$('body').on('click' , '.popoverClose' , function(e){
e.stopPropagation();
var i = $(this);
$('.inputInfo').filter('[data-info-id="' +i.data('info-id')+ '"]').popover('hide');
});
// new code
$('body').on('click', function(){
$('[rel="popover"]').popover('hide');
});
My temporary solution look like this:
I'm using:
$('.popover').remove();
to remove popovers
and
$('body').on('click' , '[rel="popover"]' , function(e){
e.stopPropagation();
var i = $(this);
var thisPopover = $('.popoverClose').filter('[data-info-id="' +i.data('info-id')+ '"]').closest('.popover');
if( thisPopover.is(':visible') ){
$('.popover').remove();
}
else{
$(this).popover('show');
}
});
to toggle popovers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With