user3686169
user3686169

Reputation:

Wait until popover is destroyed?

I'm using bootstrap and I was wondering how I can wait until a popover is destroyed before showing another element?

Here's the popover destroy call:

$('.first').popover('destroy');

I've tried doing the following, but it doesn't seem to actually make it to the second call:

$('.first').popover('destroy', function() {
    $('.second').popover('show');
});

Upvotes: 0

Views: 326

Answers (1)

Robert Levy
Robert Levy

Reputation: 29073

Does this do what you want? It waits for the popover to be hidden, not necessarily destroyed. There is no built in bootstrap event for destruction.

$('.first').on('hidden.bs.popover', function() {
   $('.second').popover('show');
});
$('.first').popover('destroy');

Upvotes: 2

Related Questions