I did a few searches, and I managed to figure out that I can attach events to buttons that make it close.
However, this does not apply when the user simply clicks elsewhere. I would like to trigger an event when the popover disappears and is deleted. Anyone have any suggestions?
Update: . I tried the answer below and could not get it to work, although this clearly follows from the jsfiddle example. There may be some conflicts with the libraries and settings that I use.
Here is the code I'm using:
this.$el
.popover({
html: true,
title: 'Schedule an appointment',
content: '<div id="' + this.popoverView.cid + '" class="event-popover"></div>',
placement: placement
})
.popover('show')
.on('hidden', function(e) {
alert('hidden');
});
popover, , on hidden. . , (data-dismiss='modal') , .
, : require.js, backbone.js, marionette.js.
jsfiddle, , : http://jsfiddle.net/zj37u/
- , ? .