Add a fired event after the component has finished loading
Sometimes we may want to know when the component is finished with it’s loading process entirely to trigger animations or something similar. I added this for my own website, and I think that others may want to use this. It’s a small addition, but I hope that it will be helpful to others!
This commit is contained in:
@@ -338,6 +338,7 @@
|
||||
web2py.trap_form(action, target);
|
||||
web2py.ajax_init('#' + target);
|
||||
web2py.after_ajax(xhr);
|
||||
web2py.fire(element, 'w2p:componentComplete', [xhr, status], target); // Let us know the component is finished loading
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -338,6 +338,7 @@
|
||||
web2py.trap_form(action, target);
|
||||
web2py.ajax_init('#' + target);
|
||||
web2py.after_ajax(xhr);
|
||||
web2py.fire(element, 'w2p:componentComplete', [xhr, status], target); // Let us know the component is finished loading
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -338,6 +338,7 @@
|
||||
web2py.trap_form(action, target);
|
||||
web2py.ajax_init('#' + target);
|
||||
web2py.after_ajax(xhr);
|
||||
web2py.fire(element, 'w2p:componentComplete', [xhr, status], target); // Let us know the component is finished loading
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user