nyroDev/nyroModal — Issue #141: Nyromodal links stop on ajax load
Author: chazari
Created: 2011-10-17 15:41:59+00:00
State: open

I'm using Nyromodal for a internship listing form. A faculty member will create an internship and add students who have done the internship to the listing. I have a Nyromodal link on the add student and edit a student's information. When you click add or edit, the window pops up with the form, processes, and closes. The system then refreshes the list to include the changes using AJAX. When the refresh occurs, the jquery is no longer bound and the Nyromodal windows stop working. I've added Event Bubbling, but it doesn't work on the Nyromodal window.

I have:

$(function() {
$('body').click(function(event) {
if ($(event.target).is('##editInterns a.editLink')) {
$(event.target).nyroModal();
}
});
});

I know the basic code works because I've tested it with:

$(function() {
$('body').click(function(event) {
if ($(event.target).is('##editInterns a.editLink')) {
$(event.target).toggleClass('formLabel');
return false;
}
});
});

and that code works fine. I've been searching for something on this and coming up empty. Any thoughts or help?