jquery-modal icon indicating copy to clipboard operation
jquery-modal copied to clipboard

AJAX loaded modal not being removed from DOM on close

Open vanboom opened this issue 4 years ago • 0 comments

When modals are opened using <a rel='modal:open'...>, they are removed from the DOM when the modal is closed. This does not happen is the modal is loaded via AJAX per the examples here.

// Open modal in AJAX callback
$('#manual-ajax').click(function(event) {
  event.preventDefault();
  this.blur(); // Manually remove focus from clicked link.
  $.get(this.href, function(html) {
    $(html).appendTo('body').modal();
  });
});

Please consider removing the modal from the DOM when it is closed the same way that it is removed when launched from a hyperlink.

I have fixed this and tested - will submit a PR, but not sure if this project still has active maintainers?

vanboom avatar Oct 03 '21 17:10 vanboom