I implemented Magnific Popup in my solutions, and I use Bootbox to get confirmation from the user that he wants to close the window without saving changes, etc.
I hooked up my custom function to close the callback, but it does not work properly.
$('#divThumbnails').magnificPopup({ delegate: 'a', type: 'inline', midClick: true, callbacks: { close: function () { var confirm = bootbox.confirm('Are you sure?', function(result) { }); if (confirm) return true; else return false; } } });
This is just a quick sample, not a production code. The if-else statement exists because otherwise the Bootbox dialog is not displayed (there is usually no need to check the return value, because it is passed as an argument, which in this example is called the result).
The problem is that after I click the close button, my image (i.e. the contents of the popup) will disappear. I would like to be able to cancel the close operation and achieve what I need an event that will fire until the popup closes.
Can this be achieved with Magnific Popup?
source share