scazzy/Popelt — pull request #5 by Jako (2014-12-28 22:52:36+00:00)
Title: Replace the popup-content if it is already visible

Useful for form submits (example code below):

```
$(document).on('click', '.popup', function (e) {
e.preventDefault();
var p = new Popelt({});
$.get(e.target.href + '?mode=popup', function (data) {
var content = $(data);
$(document).on('submit', $('form', content), function (e) {
e.preventDefault();
$.post(e.target.action + '?mode=popup', $(e.target).serialize(), function (data) {
var submitted = $(data);
p.setContent(submitted);
p.show();
});
});
p.setContent($(data));
p.show();
});
})
```